Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] Add data under post #'x' in index.php (http://forum.bytesforall.com/showthread.php?t=19489)

ryoung Jan 28, 2013 01:25 PM

[SOLVED] Add data under post #'x' in index.php
 
So what I'm trying to accomplish is to add a bit of code underneath the 5th post excerpt listed on the index page.

I've looked at the index.php and see it calls bfa_loop( 'post_format' ), so I thought I might be able to figure out how to do it by looking at the bfa_loop code, but I couldn't find it in the theme files :(

What I'm thinking will work is if I use some code like this:
Code:

<?php if(!$show_code){ ?>
<code>
<?php $show_code = 5; } ?>

But I'm not sure what to look at, or where it should be plugged in. Has anyone done anything like this with this theme? Can you point me somewhere?

-Randy

juggledad Jan 28, 2013 03:02 PM

here is how you can do it.
1) add a dynamic sidebar (it's a widget area) with a name like 'Post widget' where you want it in the post - ie above teh content, below it etc
2) add thte plugin 'exec-php' to your site
3) go to the widget area and add a text widget to the new 'Post Widget' area
4) add some code like this to the text widget
HTML Code:

<?php global $mycount;
$mycount += 1;
if ($mycount == 5) { echo 'ad goes here'; }
echo 'count='.$mycount.'<br>';
?>


ryoung Jan 28, 2013 06:28 PM

So are you saying I should create a widget area 'inside' of the 'post format' sub template?

ryoung Jan 28, 2013 06:52 PM

Thanks, adding the widget area in that position did it! I didn't realize I could add widget areas and not associate them with columns. Thanks for the insight.


All times are GMT -6. The time now is 09:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.