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 » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] Trying to add ads in category pages


  #1  
Old Jan 25, 2013, 11:15 AM
mkellam
 
60 posts · Jan 2011
Hi,
In the past, I asked how to place ads after the 3rd and 6th post on category pages. The following code has worked great but when I updated to 3.7.10, I noticed the ads are gone. It turns out they've been gone since i upgraded from 3.7.3. I think this means one of the variables has cvhanged in the newer versions. Can you please tell me what changes I need to make th this code to make it work on the current version? Thanks! Michael


<?php if ( is_category() AND (($bfa_ata['postcount'] == 3 ) OR ($bfa_ata['postcount'] == 6 )) ) { ?>

[Ad Code Goes Here]

<?php } ?>
  #2  
Old Jan 25, 2013, 02:44 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
because of wordpress requirements, php in the theme options is no longer allowed. You will have to edit the index.php and put that code in it.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jan 25, 2013 at 09:24 PM.
  #3  
Old Jan 25, 2013, 02:59 PM
mkellam
 
60 posts · Jan 2011
Hi Juggledad,

Thanks for your answer. I have not been using it in the theme options the last several versions, so I have been hard coding it into the index file, but even though it worked hard coded in a previous version, it's not working anymore.

Does it look like I'm calling for something that's been deprecated or does it look like it should work this way? I assumed that one of the functions had changed.

Thanks very much!

Michael
  #4  
Old Jan 25, 2013, 05:23 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
that looks fine, but did you re-add it into index.php after the update?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jan 25, 2013, 06:09 PM
mkellam
 
60 posts · Jan 2011
Yes, I added it to the index. I have several other ads included in different places in the index and they're showing up fine.

I switched back to my Atahualpa 3.7.3 and the ads showed up again with no problem.

When I compared the index files for the 3.7.3 and the 3.7.10, that PHP and ad coding appears to be exactly the same and located in the same place in the index file, so I'm not sure why it would show up in one version of the theme and not in the other.


I just did a few more tests:
  • I placed the ad code directly in the index.php without the php is_category protocol and the ad showed up fine.
  • Then I re-added the php is_category protocol and replaced the ad with the word "test" but the word test did not show up on the page.
  • Then I tried the word "test" with the postcount=3 and removed the OR postcount=6 and the word test still did not show up on the page.


To me, this suggests that something is wrong with the PHP statement except that the same statement worked fine with Atahualpa 3.7.3.

Could it be the placement in the index file? It's the same place where I had it in the 3.7.3 index but other things have changed in that file.


If none of this rings a bell, can I send you both index files so you can see if I've missed something?

Thanks again!

Michael
  #6  
Old Jan 25, 2013, 09:25 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Attach the files
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jan 29, 2013, 02:49 PM
mkellam
 
60 posts · Jan 2011
Hi Juggledad,

Here they are. Sorry for the delay. We were down with the flu.

Again, the problem is only with the ads after the 3rd and 6th posts on the category pages. All other ads are fine.

Thanks for checking!

Michael
  #8  
Old Jan 29, 2013, 02:50 PM
mkellam
 
60 posts · Jan 2011
Oops apparently forgot to attach. Here it is. Thanks! MK
Attached Files
File Type: zip index-files-troubleshooting.zip (5.3 KB, 1198 views)
  #9  
Old Jan 29, 2013, 05:24 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
look at the line after this line in both
HTML Code:
<?php /* If there are any posts: */
then look at your code.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Jan 30, 2013, 12:59 PM
mkellam
 
60 posts · Jan 2011
Thanks, Juggledad! I thought something might have changed - That variable changed but I never changed it in my changelog and kept updating it incorrectly. Thanks for looking!

Michael

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Styling the category pages guaccio2209 Atahualpa 3 Wordpress theme 6 Oct 30, 2011 08:51 AM
How to Set Meta Title for Category Pages New WordPress Fan Forum How-To 1 Oct 27, 2011 07:10 PM
[SOLVED] How to: display category name on category pages wittyusername Center area post/pages 3 Feb 25, 2011 07:25 AM
Images in my category and archive pages? middlemountain Atahualpa 3 Wordpress theme 1 Apr 11, 2009 11:28 PM
How to place ads at top of category pages? RuthSmith Atahualpa 3 Wordpress theme 3 Feb 25, 2009 01:49 PM


All times are GMT -6. The time now is 12:10 PM.


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