Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] Trying to add ads in category pages (http://forum.bytesforall.com/showthread.php?t=19447)

mkellam Jan 25, 2013 10:15 AM

[SOLVED] Trying to add ads in category pages
 
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 } ?>

juggledad Jan 25, 2013 01:44 PM

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.

mkellam Jan 25, 2013 01:59 PM

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

juggledad Jan 25, 2013 04:23 PM

that looks fine, but did you re-add it into index.php after the update?

mkellam Jan 25, 2013 05:09 PM

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

juggledad Jan 25, 2013 08:25 PM

Attach the files

mkellam Jan 29, 2013 01:49 PM

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

mkellam Jan 29, 2013 01:50 PM

1 Attachment(s)
Oops apparently forgot to attach. Here it is. Thanks! MK

juggledad Jan 29, 2013 04:24 PM

look at the line after this line in both
HTML Code:

<?php /* If there are any posts: */
then look at your code.

mkellam Jan 30, 2013 11:59 AM

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


All times are GMT -6. The time now is 01:53 PM.

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