• Resolved wordart88

    (@wordart88)


    Similar to the issue described in this support thread, my related posts are showing the same posts everywhere unless I insert the php code inside or close by(!) the WordPress posts loop.

    My blog theme has a layout in index.php with two columns (left: posts, right: sidebar) and below them a block with full width where I want the related posts to show up. Right now my solution is to insert the plugin code inside the left column (near posts loop) and then move the block down with jQuery .appendTo() inside a wrapper down below while the page is loading. The related posts are hidden and then fades in with jQuery when the page is loaded to avoid flashing when it appends.

    This solution doesn’t seem optimal and I think it causes some problems for visitors with slower connections right now and/or might make it harder for a sticky sidebar to understand the page height.

    Do you have another suggestion how to solve this? Can I maybe insert the plugin code in the bottom where I want it and use a global $post variable as an argument? Or a better way with jQuery?

    https://www.ads-software.com/plugins/contextual-related-posts/

Viewing 1 replies (of 1 total)
  • Plugin Author Ajay

    (@ajay)

    Hi,

    You have complete flexibility on where you would like to add the post within a page if you’re editing your theme files.

    By default, the plugin uses a global $post variable that is set. Have you tried moving this anywhere else in the theme file?

    Also see a sample API code for advance use: https://gist.github.com/ajaydsouza/968b24a052e858bf8926

Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion for showing outside of posts loop?’ is closed to new replies.