Conflict between Plugins: The Grid and Recent Posts

Good afternoon,

I noticed that Classic Recent Posts element got a weird conflict with The Grid plugin on video posts. If I add Recent posts element at the end of post –either via shortcuts or Cornerstone–, The Grid shows Home Page instead the post itself (although if you click on it, it takes you to the actual post). The element works totally fine with standard post type.
You can see an example at the bottom of my home page on Featured Videos (Cinemagraph tutorial shows as Home): http://www.ahtzirilagarde.com

Hello There,

Thanks for writing in! Yes it creates a conflict because WP_Query in the grid is mixed up with the addition of the recent post element. It is not recommended to add it via a shortcode or even with an element. You may programatically add it using a custom function instead.

Assuming that your child theme is active already, please add the following code in your child theme’s functions.php file

function x_add_recent_posts( $content ) {
  if ( is_singular('post') ) {
    echo do_shortcode('[x_recent_posts count="2"]');
  }
}
add_action('x_before_the_content_end', 'x_add_recent_posts');

Hope this helps.

Oh, thanks a lot! Now i get it.
YEs, I have a child theme active so I think your solution will work. My only question would be: when you use recent posts you are able to choose which category you’d like to show, so adding it in my functions.php file wouldn’t let me choose it, right?

Hello There,

When using the recet post shortcode, you may still choose which category to display. Simply use this:

[x_recent_posts count="2" category="category-name"]

To know more about this shortcode, check it here:
http://demo.theme.co/integrity-1/shortcodes/recent-posts/

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.