WordPress.org

Ready to get started?Download WordPress

Forums

Static Category Page & Related Posts (6 posts)

  1. kbrown75
    Member
    Posted 2 years ago #

    Hi there,

    For SEO reasons I am trying a new approach where my Category is a static landing Page. Sort of a Silo approach.

    Example

    I created a Page called "mycategory" so instead of having a Category archive page:
    http://www.mywebsite.com/category/mycategory

    I now have a static Category landing page:
    http://www.mywebsite.com/mycategory

    My problem is Navigation. I need visitors to be able to see any Posts in "mycategory" in the sidebar when they view the "mycategory" landing page.

    Any ideas?

    thanks
    Kevin

  2. richarduk
    Member
    Posted 2 years ago #

    <?php wp_get_archives('type=postbypost'); ?>

    Show post titles (above) or just add in another loop (below) for more flexibility

    <ul>				
    
    <?php $loop2 = new WP_Query( 'posts_per_page=200&cat=3&ignore_sticky_posts=1' ); ?>
    
    <?php if ( $loop2->have_posts( ) ) :  while ( $loop2->have_posts( ) ) : $loop2->the_post( ); ?>
    
    <li><a class="most-recent" href="<?php the_permalink( ) ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute( ); ?>"><?php the_title_attribute( );?>
    
    <?php endwhile; ?>   
    
    <?php else : ?>  
    
    <p> Sorry, no posts were found! </p>
    
    <?php endif; ?> 
    
    <?php wp_reset_query( );?>
    </ul>
  3. kbrown75
    Member
    Posted 2 years ago #

    Thanks for that Richard.

    I'm afraid to say though that it looks outside my comfort zone.

    I've continued to look into this after posting my question.

    Do you think I can get away with just using the Custom Menu?

    This way I can have PAGE1 -> post1, post2, post3...PAGE2 -> post4, post5, post6...etc. in one of my navigation bars?

    Kevin

  4. richarduk
    Member
    Posted 2 years ago #

    Yes, but you have to add them manually. And if you have a lot of posts it'll take forever and look very crowded in your Admin screen. And if you're using a drop down menu users won't know those posts are there until they mouseover the links.

    Better bet would be to see if there's a widget that shows category pages. There's a default one in WP in the Appearance / Widgets screen

  5. kbrown75
    Member
    Posted 2 years ago #

    Yeah, that's kind of where my issue started.

    Using the standard Category widget only shows the Category Archive Posts page but then visitors won't see my Static Category Landing Pages?

    I probably won't have more than 20 posts so I guess I'll try the Custom Menu route for now.

    thanks
    Kevin

  6. Digital Raindrops
    Member
    Posted 2 years ago #

    See if two plugin's will work together Single Category Widget and select the category for the home page.

    Then add Widget Logic if this works with above just add the condition is_home() || is_front_page()

    If it works you can have any content on the static page, with any page name, no code required!

    Let us know how you get on.

    David

Topic Closed

This topic has been closed to new replies.

About this Topic