Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Calling Specific Recent Posts

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #35274
    mikelegacy
    Member

    Hey guys, I need a way to call a specific recent post inside a DIV.

    Here is my grid setup:

    http://legacycreativestudio.com/gridsetup.png

    Basically, I need the Recent #1 DIV to call the first most recent post. The Recent #2 DIV needs to call the most recent posts as well but exclude the 1st most recent post. So on and so forth until all five most recent posts are displayed. I am going to be running 5 different loops, one in each DIV.

    But, while we are on the subject, I need the Thumbnail of each recent post to display in the div right about Recent #2-5 and to the right of the Recent #1. (see the image I posted to know what I’m talking about)

    Here is the current loop I am using. I am currently just calling a static post and having to update it every time new posts are written. It’s annoying and I want to change it to do this dynamically.









    id="post-">

    ">














    Thanks guys!

    #91041
    TheDoc
    Member

    I wouldn’t use five different loops. I would just use two. I would use one loop to get the most recent and then the other loop to get the rest and you can use the offset parameter to make sure the first one isn’t included.

    #91047
    mikelegacy
    Member

    They are all in separate DIVs though….that’s the problem.

    And each post needs to have it’s thumbnail styled to appear above the excerpt.

    Could I create an inline-block list and display the posts in separate “LI” tags and that way, each post would be in the same DIV but different “LI” tags?

    Again, I’m new to WP and PHP so this is all pretty new to me.

    #91052
    TheDoc
    Member

    All in separate divs is fine. Just wrap each post/thumb in the same div. Each of the colors in this screenshot represent a div:
    http://grab.by/bh9q

    And then you just float each of them to the left. And they can all be given the same class name.

    #91055
    mikelegacy
    Member

    Do you know how to call JUST a thumbnail? I keep getting a fatal error of Call to undefined function the_post_thumbnail in….

    I am putting this within my loop and just leaving out “?php the_content ?” completely

    
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail();
    }
    ?>
    #91056
    TheDoc
    Member

    Nothing looks wrong with the code you posted, so I’m guessing that means you’ve simply put it in the wrong spot or haven’t closed some PHP tags before it.

    Here is the basic structure of what your two loops should look like:



















    #91091
    mikelegacy
    Member

    My functions page was empty for some reason. I was using Starkers so it had a ton of functions in there before….must have been an error with FTP or something. It’s working fine now.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.