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] Content Added to Loop has vanished (http://forum.bytesforall.com/showthread.php?t=7588)

NoisyDvL5 Jun 15, 2010 04:28 AM

[SOLVED] Content Added to Loop has vanished
 
Hello,

Love the theme, but I've been tinkering and have perhaps altered something and caused an adsense that is placed in the loop to disappear.

I deleted the code and reinstalled it as

<?php if ( is_front_page() AND $bfa_ata['postcount'] == 3 ) { ?>
ADSENSE CODE HERE
<?php } ?>

But I haven't been able to get it to come back, so I'm guessing I've crossed streams somewhere.

Based on the dropoff in impressions, the image ad vanished yesterday. The only changes I made to the site in that time frame was some work on a custom template for related posts, editing the size of the page numbers that appear with the nextpage tag, and removing some of the padding on the page/post items to tighten up the front page.

All the changes were fairly simple (except for my inability to center the images on the related posts template), so I don't think they could've caused the ad to vanish, but I don't know what else would.

Thanks in advance for any help. This is my site if that can help solve this mystery...

http://www.itsalltrue.net

juggledad Jun 15, 2010 04:32 AM

What version of Atahualpa and WP?
where did you put that code?

NoisyDvL5 Jun 15, 2010 04:44 AM

I knew I'd leave something out. :)

Wordpress is 2.9.2 and Atahualpa is 3.4.9.

The code is placed in the Loop box on the Style/Edit Center Column as the given examples on that page suggest.

juggledad Jun 15, 2010 08:10 AM

please copy and past the entire contents of 'The LOOP' so I can see what you have. If there is something that is private, send it to me in a PM

NoisyDvL5 Jun 15, 2010 11:46 AM

Thank you for your help/patience.

I'm not sure if I'm allowed to repost the Adsense code, but it's precisely copied from Google with no alterations. Here's the rest of the contents of the loop box:

Quote:

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */ bfa_next_previous_post_links('Top'); ?> <?php /* Post Container starts here */ if ( function_exists('post_class') ) { ?> <div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>"> <?php } else { ?> <div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>"> <?php } ?> <?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?> <?php bfa_post_headline('<div class="post-headline">','</div>'); ?> <?php bfa_post_byline('<div class="post-byline">','</div>'); ?> <?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?> <?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?> <?php bfa_post_footer('<div class="post-footer">','</div>'); ?> </div><!-- / Post -->

<?php if ( is_front_page() AND $bfa_ata['postcount'] == 3 ) { ?>
<script type="text/javascript">ADSENSE
</script>
<?php } ?>
I've tried a simple test using the basic 'postcount' php to add a small snippet of text and I couldn't get it to appear on the front page either.

Could I have done something to violate the conditions, so that "third post" trigger never gets tripped?

The only formatting (mucking) I've done was to

-add some text formatting to page numbers in the "bfa_post_parts.php". I did remove some code from the pagination section so that the page numbers wouldn't appear on the main page, but I did that weeks ago.

-adapted a custom template for related posts and added some css inserts to govern it.

-changed the padding on the various post/page items

juggledad Jun 15, 2010 12:07 PM

it's got to be something else you did, or the adsence script.

I just stuck your code into The LOOP at my site, took out the <script...> and </script> and I see the word ADSENCE on the third post.

NoisyDvL5 Jun 15, 2010 01:15 PM

That's what I feared.

On my site, the word "ADSENSE" doesn't show up with the same test.

Again, thank you for your help and patience. I've run through the changes I made...

I can see no way that the simple changes to the padding could have caused this. All the syntax is correct.

Removing the nextpage page numbers from the main page I accomplished by editing bfa_post_parts.php :

This was probably ill advised, but I simply removed the if conditions on the pages where I didn't want the page numbers to show. I did this awhile back, so I don't believe it's related. Here's the code I left on that page:


Quote:

function bfa_post_pagination($before = '<p class="post-pagination"><strong>Pages:', $after = '</strong></p>') {

global $bfa_ata;

if ( (is_author() AND $bfa_ata['excerpts_author'] == "Full Posts") OR
is_single() OR is_page() ) {
wp_link_pages('before=<center><h3>'.$before.'&afte r=</h3></center>'.$after. '&next_or_number=number');
}

}
That leaves the YARPP plugin with custom template. The template and CSS inserts that govern it would appear to be unrelated, but I just tried deactivating the plugin and received this error message:

Quote:

Fatal error: Call to undefined function related_posts() in /home/itsallt/public_html/wp-content/themes/atahualpa/functions/bfa_postinfo.php(593) : eval()'d code on line 4
I assume this is refering to line 593 of that page. This is the snippet of code that contains line 593

Quote:

/* PHP code in Post Info Items.
But not for WPMU */
/*removed in 3.4.3. - PHP code works in WPMU too */
if ( strpos($postinfo_string,'<?php ') !== FALSE ) {
ob_start();
eval('?>'.$postinfo); <---593
$postinfo = ob_get_contents();
ob_end_clean();
}
Could this be related? Is this something that should be addressed with the YARPP author?

juggledad Jun 15, 2010 01:47 PM

my suggestion would be to get a fresh copy of bfa_post_parts.php. rename the current one and load up teh fresh cop to see if the code in The LOOP starts to run. If it does, you can start to play with bfa_post_parts.php again.

here is what I did to the LOOP code you provided
HTML Code:

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */ bfa_next_previous_post_links('Top'); ?> <?php /* Post Container starts here */ if ( function_exists('post_class') ) { ?> <div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>"> <?php } else { ?> <div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>"> <?php } ?> <?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?> <?php bfa_post_headline('<div class="post-headline">','</div>'); ?> <?php bfa_post_byline('<div class="post-byline">','</div>'); ?> <?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?> <?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?> <?php bfa_post_footer('<div class="post-footer">','</div>'); ?> </div><!-- / Post -->

<?php if ( is_front_page() AND $bfa_ata['postcount'] == 3 ) { ?>
ADSENSE
<?php } ?>

this will just put the word 'ADSENSE' on the page

NoisyDvL5 Jun 15, 2010 06:14 PM

On your suggestion I pulled a fresh copy of bfa_post_parts.php from my blog and swapped it out with my edited version. The page numbers reappeared on my main page, but the loop didn't produce the ad after the third item with either version of the loop code.

I've posted on the support forums of the plugin author since this seems more and more to be on that end (unless I'm just on the wrong track). I'm somewhat dismayed that I can't deactivate the plugin because not having it turned on causes a fatal error with postinfo.php.

juggledad Jun 16, 2010 03:23 AM

If you add code to an atahualpa module that calls a function in a plugin then deactivate thevplugin, the function will not be found and you can expect that type of error.

NoisyDvL5 Jun 16, 2010 10:14 AM

You're dead on. I did a add a snippet of code into the footer for the plugin.

I swapped out the post parts, removed that code, and deactivated the plugin, basically undid all the changes I made to the site. The website loaded regularly, but the content was still missing from the loop.


I'm at a loss. Would upgrading to a newer version of the theme have a chance of fixing the problem?

juggledad Jun 16, 2010 01:34 PM

nope, if you want to send me a PM with an admin ID and PW 'll take a look

NoisyDvL5 Jun 17, 2010 02:24 PM

I'll have to check and make sure that's okay with the bossman, but it shouldn't be a problem.

Thanks for the help!

NoisyDvL5 Jun 26, 2010 01:36 AM

Sorry that it took me so long to come back!

Apparently, all the work I was doing to fix the ad I lost was for nothing! When I explained everything, the webmaster said she wanted to get rid of it and wanted me to take the opportunity to go to a two column format.

Thank you again for your help!


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

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