WordPress.org

Support

Support » Themes and Templates » [Resolved] Tweaking and pasting the loop into single.php – Please help!

[Resolved] Tweaking and pasting the loop into single.php – Please help!

  • Dear all,
    I’m currently putting together a website at http://www.treacletheatre.co.uk/portfolio/susanne/ and need some help tweaking the php files. It runs on the wpshower imbalance theme. All content is just for testing at the moment.

    I would like the loop that appears on the start/home page to appear underneath the single pages. I’ve tried copy and paste but only the post I am currently on appears. I can’t figure out what I should change in the loop so that all the posts show up. I could give them all the same category if that helps. Here’s the code. The first bit is for the single page (the original single.php), then after ‘Portfolio’ you get the loop from index.php.

    Any help greatly appreciated!

    Kaspar

    [code moderated – please use the pastebin]

    The second issue is probably a CSS issue. The roll-over text for the thumbnail in the index.php loop that I have copied under the single post aligns itself with the content of the single post rather than the main body. Do I need to add another class or is there another way of sorting this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Here’s the code on Pastebin.com: http://pastebin.com/raw.php?i=z7NXev3c

    Anybody out there that can help!
    Would be greatly appreciated!
    K

    I’m no expert , and aren’t sure what you are describing in copy and paste but I’ve used the same theme. Have you tried template tags as an option, or perhaps footer widgets which show all the posts that are only activate on pages? Or do you mean that you want the loop theme and not just the content on single pages as well?

    You can try the other way around and use a plugin that creates new widget areas, along with a ‘page in widget’ plugin or tabbed widget to show navigable pages on the home.

    hope that gives an idea

    Hiya Stacy and thanks for your response,
    I’m after the single page as it already is, and then the loop from the homepage underneath. So after you scroll down to the end of the post you see all the other posts as they appear on the home page. A bit like it is done in the follow-up theme Imbalance2.
    Would I be able to put all the posts, with thumbnails, etc as they appear on the homepage in a footer widget?
    I guessed it is just a matter of adding or changing something in this bit:
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    <li class=”article” id=”post-<?php the_ID(); ?>”>

    But no idea what.
    K

    I see what you mean about it only showing one post. You would have to find a widget that displays latest posts in a similar fashion if you use a plugin. The quickest way I can think of is to use a frameless iframe in the page itself.

    Hiya Stacy,
    Sounds good but how do I create that!?
    And why does it only show one post when it is the same loop as in the home page?

    it was oh so easy in the end!
    just needed to add a query.
    <?php query_posts(‘cat=stage design’); ?>
    now to solve the other issue. i guess i need a new div class.
    hope my DIY amateur fiddling works on other browsers.
    k

    Here’s the issue again:
    The roll-over text (metadata) for the thumbnail in the index.php loop that I have copied under the single post aligns itself with the content of the single post rather than the main body. Do I need to add another div class or is there another way of sorting this? Any help greatly appreciated! K

    Test website example at http://www.treacletheatre.co.uk/portfolio/susanne/2012/01/25/6/

    second issue sorted. can get on and build the site now.
    needed to add a copy of the class causing the issue, with a .single prefix in the stylesheet (problem was that this class is usually only assigned to the homepage)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Tweaking and pasting the loop into single.php – Please help!’ is closed to new replies.
Skip to toolbar