Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

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


  #1  
Old Jan 28, 2013, 01:25 PM
ryoung
 
32 posts · Nov 2012
[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
  #2  
Old Jan 28, 2013, 03:02 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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>';
?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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



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 04:06 PM.


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