WordPress.org

Ready to get started?Download WordPress

Forums

Posts in Page
[resolved] template='loop.php' not working (8 posts)

  1. senthilmaster
    Member
    Posted 1 year ago #

    Hello!
    Thanks for this great plugin, which should be doing what I want, however when I add template='loop.php' in the shortcode (to style the posts from the designated categroy as my general posts - I'm using TwentyTen) the page content takes time to load and is finally empty, so is the sidebar...
    I also tried saving loop.php with another name but it didn't work.

    Here's the website : http://www.axoscience.com
    The general posts page comes in the R&D PROJECTS menu (which displays all the posts under the parent category 'projects') and I wand to use your plugin in COMPANY/NEWS (www.axoscience.com/company/news/), which is a child-page of 'company' and displays all the posts from the category 'news'.
    [ic_add_posts category='news'] wokrs fine but I would like to style the posts in the same way as R&D PROJECTS, and when I try [ic_add_posts category='news' template='loop.php'] the page and sidebar becomes empty...

    Is there something I'm doing wrong?

    http://wordpress.org/extend/plugins/posts-in-page/

  2. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Hey Senthilmaster,

    Thanks for the post.

    I'm not sure what's going on offhand, and will have to do some testing, but am wondering if you tried copying the posts_loop_template.php to your theme directory and making the necessary changes there?

    If you do that, you can tailor the output using that template and then you won't have to specify the template name.

    I'll do some testing here and see if I can replicate your issue and report back.

    Eric

  3. senthilmaster
    Member
    Posted 1 year ago #

    Thanks so much for you swift answer!

    Yes I did copy loop.php (in TwentyTen it is just called loop) and tweaked it so that my posts are displayed as I want in http://www.axoscience.com/category/projects/anr/, and I would like the posts displayed in my news page (http://www.axoscience.com/company/news/) using your plugin's shortcode to actually look exactly the same, which is not the case when I only use [ic_add_posts category='news'], that's why I tried adding template='loop.php'...

    Thanks for letting me know if you find what's wrong.

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the problem is likely that in Twenty Ten, loop.php actually contains the loop, and is not just an output template like content.php in Twenty Eleven.

  5. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    senthilmaster,

    You replied before I've done any testing, but pardon me; I'm still a bit confused. Here's my question more directly:

    Did you copy the posts_loop_template.php from wp-content/plugins to your theme directory and then copy in the loop information from from TwentyTen's loop?

    Or, did you just copy the existing loop file and try to point to it using the template= attribute?

    If you haven't already, try the former.

    Eric

  6. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    the problem is likely that in Twenty Ten, loop.php actually contains the loop, and is not just an output template like content.php in Twenty Eleven.

    Exactly right!

    So, senthilmaster, the issue is that loop.php in the Twenty Ten theme contains a loop, but the posts_loop_template.php file is only an output template and it doesn't contain a loop. The loop for the plugin is handled elsewhere.

    My recommendation: copy the posts_loop_template.php from wp-content/plugins to your theme directory and tailor as you see fit.

  7. senthilmaster
    Member
    Posted 1 year ago #

    Allright I get it now! My confusion came indeed from thinking posts_loop_template.php was the THEME's loop, but it is actually the PLUGIN's loop...
    Sorry I'm really not good with coding and all these technical things :)

    So yes now it is working!
    I should manage tweaking this file to my needs...

    Thank you so much for your help, both of you.

  8. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    You're quite welcome; glad you got it working.

    Have a great weekend!

    Eric

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags