Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

[SOLVED] Add data under post #'x' in index.php


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Jan 28, 2013, 01:25 PM
ryoung
 
32 posts · Nov 2012
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
  #2  
Old Jan 28, 2013, 03:02 PM
juggledad's Avatar
juggledad
 
22,104 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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>';
?>
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #3  
Old Jan 28, 2013, 06:28 PM
ryoung
 
32 posts · Nov 2012
So are you saying I should create a widget area 'inside' of the 'post format' sub template?
  #4  
Old Jan 28, 2013, 06:52 PM
ryoung
 
32 posts · Nov 2012
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.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Post on index iSpectra Montezuma Theme 16 Nov 4, 2012 11:11 PM
Add data on post container near the headline guaccio2209 Center area post/pages 0 Nov 6, 2011 10:27 AM
How can I alter index.php to omit certain post data? David Crowther Atahualpa 3 Wordpress theme 1 Oct 4, 2010 07:17 PM
How to not have Google index my sidebar data? gabrielnovo Atahualpa 3 Wordpress theme 5 May 6, 2009 06:46 AM


All times are GMT -6. The time now is 08:02 AM.


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