Jump to content
Sign in to follow this  
Rob

Upgrade caused RSS problem?

Recommended Posts

Rob

On my Glossary section, http://www.epicurus.com/Glossary/ I used Shortcode Exec PHP to include the following code:

// Prevent recursion
	global $outerPost;
	if ($outerPost)
	return '';
	// Parse parameters
	extract(shortcode_atts(array('query' => 'post_type=post'), $atts));
	$query = html_entity_decode($query);
	// Create new post loop
	global $post;
	$outerPost = $post;
	$my_query = new WP_Query($query);
	while ($my_query->have_posts()) {
	$my_query->the_post();
	setup_postdata($my_query->post);
	// Process post
	?><?php the_title();?>
<?php
	}
	$post = $outerPost;
	unset($outerPost);
	$id = $post->ID;
	wp_reset_query();[/code]

	
	Now this section repeats (with variables changed) a total of 5 times in the boxes near the bottom of the front page. It was working perfectly as late as this morning.  Then, I upgraded PlatformPro to 1.5.3.
	
	Suddenly, each box shows the image I set for it, a large blank space and an image (that doesn't belong there.) Below each image (all the same for each box), there is a snippet or excerpt from 1 post, repeated 5 times across the boxes. Previously, this displayed a simple list of 5 linked titles of recent posts.
	
	Naturally, I've deactivated plugins and found no change.
	
	Here's my Custom CSS for reference:
	
[code]body { padding-top:0px; } div.leaderboard {float: right;} #cred {display: none;} #branding .content-pad {padding: 20px 0px 24px;} .scolumn-pad {padding: 1.25em 0.7em;} #playlist tbody tr.even td {background-color: #e7e7e7;} #playlist tbody tr.odd td {background-color: #ffffff;} .category #feature{display:none;} .search #feature{display:none;} .category #boxes {display:none;} .search #boxes {display:none;} .archive #boxes {display:none;} .archive #feature{display:none;} #sidebar-wrap #sidebar_universal {padding: 1.5em 0.7em 0;} #footer .content-pad {padding: 15px 0 1em;} #content {padding: 1.25em 20px 0 15px;} .tag #feature, .category #feature{display:none} #feature_slider div.default-features {width: 630px;} #feature-area {width: 630px} .home #feature-footer {width: 630px;} .home #feature_slider{width:630px;} .home #feature-area, .feature-wrap {width: 630px;} .home #feature-footer {width: 630px;} .home #sidebar-wrap{margin-top:-370px;}

Any ideas? PLEASE!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Simon
The box code was changed to the_content() so you can now use shortcodes in the boxes. Where are you inserting this PHP?

Share this post


Link to post
Share on other sites
Rob
I'm sorry Simon, the PHP goes into Shortcode Exec PHP which generates a shortcode. Here's an example of the shortcode [code][shortcode-organics query="cat=2191&showposts=5"][/code] A different shortcode for each one of the 5 different sections.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Simon
Your code is using global $post..what are you trying to do just list 5 posts in a category? You can revert the change in section.boxes.php look for the_content change to do_shortcode You code works fine when you not in the loop. ;)

Share this post


Link to post
Share on other sites
Rob
Yes, it does fail only in the loop, sorta. In the Boxes (settings), the posts show, but the image set for the first box shows up for each box. In the loop, each correct image shows. I wonder if there's some sort of code conflict? I will restore the section.boxes.php from an earlier edition.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob
As soon as I restored the older version (1.5.2), it came back perfectly. Thanks Simon. Does this mean there's some issue with the new version? Just in case this issue comes up for others.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Simon
No lol as i mentioned 2 posts up, the box render code changed from do_shortcode to the_content to allow easier shortcode usage in boxes, as requested. Your code is bad ;) you are messing with the loop and not reseting it! Add me on skype and we can work a better solution for you.

Share this post


Link to post
Share on other sites
Simon
[code] function my_recent_posts_shortcode($atts){ extract(shortcode_atts(array('limit' => 5, 'cat' => ''), $atts)); $q = new WP_Query('cat=' . $cat . '&posts_per_page=' . $limit); $list = ''; while($q->have_posts()) : $q->the_post(); $list .= sprintf( '%2$s
', get_permalink(), get_the_title() ); endwhile; wp_reset_query(); return $list; } add_shortcode('recent-posts', 'my_recent_posts_shortcode'); [/code] Wrote a shortcode for you. ;) You can even name it after me lol usage [recent-posts] returns 5 posts from default cat [recent-posts cat="26"] return 5 from cat 6 [recent-posts limit="3" cat="26"] can you guess? ENJOY

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×