WordPress.org

Forums

List of older Posts ony showing on one page (11 posts)

  1. cesbloggan
    Member
    Posted 4 years ago #

    Hi,
    I am making a site which is mainly a website with static pages. Only the front page holds the blogging posts. How do I keep a widget including only older posts on that page only?
    Tha is, I dont want any widgets relating to posts on any other page than the first (blog) page.
    Hoping for help!

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Are you sure you mean "widgets"? If so, you could create a custom sidebar and load that into index.php using something like <?php get_sidebar('home');?> (assuming your new sidebar was called sidebar-home.php).

  3. cesbloggan
    Member
    Posted 4 years ago #

    Well, it is easy to use a widget with for example categories in. Which is why I wrote that. And I am not sure how to code a custom sidebar to hold older posts...
    It doesn't have to be a widget but the person who updates the site definitely shouldn't have to bother about putting the older posts there.

    Somehow I thought this would be a fairly common wish :-). And that I just couldn't find it..

  4. cesbloggan
    Member
    Posted 4 years ago #

    Hm, how would I tweak the code of the sidebar to actually show the posts as opposed to the "regular" sidebar?

    At the moment I am working with only a custom widget plugin called Side Content as I have different sub-menu systems for different pages. (http://figure-w.co.uk/wordpress-side-content-plugin)
    Since that plug-in only shows the code inserted on the pages I want them to show on (but don't take php) I still have all the code for calling the regular blog widgets in my sidebar. I haven't needed to remove them. They are just deactivated.

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar_right') ) : ?>
    I guess this is the main "call" for widgets.. How would I tweak that to call the Older posts? And what do I remove on the regular sidebar.php to avoid calling it on the other pages?

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    If you want to display older posts in a sidebar, you'll need to read up on multiple Loops.

  6. cesbloggan
    Member
    Posted 4 years ago #

    OK, thanks!
    Another question, I would like to have my posts page (index-page of the site) have three lower level pages, that is static pages, not other posts or categories or something. Is that possible?

    And while I am writing, is it possible to make topmenu first level items not clickable? So that they act only as rollovers for the actual menu items?

    Sort of like this:

    <ul>
    <li><a href="#">About</a></li>
    <li class="sub level item"><a href="theteam.php">The Team</a>
    </ul>
  7. esmi
    Forum Moderator
    Posted 4 years ago #

    If you want to include static pages as well as posts on your front page, you're looking at multiple Loops again.

    And while I am writing, is it possible to make topmenu first level items not clickable?

    Not if you're using something like wp_list_pages.

  8. cesbloggan
    Member
    Posted 4 years ago #

    OK I'll have a thourough look at it.

    Although I don't want the entire posts in a sidebar, only a list of the latest posts.

  9. esmi
    Forum Moderator
    Posted 4 years ago #

    Have a look at the Recent Posts widget in Admin/Appearance/Widgets.

  10. cesbloggan
    Member
    Posted 4 years ago #

    I know that one.. :-) the problem i I only want it on the one blog page and not on the other ones. And since I need to call the sidebar for other widgets (Side Content) it will appear evrywhere. I have the Flexi Pages Widget but as far as I remember it displays all pages.

  11. esmi
    Forum Moderator
    Posted 4 years ago #

    You could set up a second widget capable area in your sidebar that is only displayed on the Blog page.:

    <?php
    if( is_home() ) :
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Blog Only') ) : ?>
    <?php endif; endif;?>

Topic Closed

This topic has been closed to new replies.

About this Topic