Suggestion for showing outside of posts loop?
-
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?
- The topic ‘Suggestion for showing outside of posts loop?’ is closed to new replies.