Remove sticky posts from Blog Page Template?

Viewing 15 posts - 16 through 30 (of 32 total)
  • #12285
    judyjudy
    Participant

    I’m having the same problem. The sticky (image) posts that I’m using for the home page slider (using landing page template + featured image + sticky post) are also showing on my blog page. I don’t want this duplication of posts — want to have the ability to exclude the slider posts from my blog page. I expected this to be something I could set (like a category option) in theme options.

    Looks like I’ll end up hacking one of the blog templates to show only posts that are assigned a specific category.

    This is such a great theme to be missing this option . . . .

    #12325
    DanimalXC
    Participant

    @judyjudy – it is a great theme, and what’s frustrating is how little clarity there is on this particular issue. As in, is it a bug? Are we just misreading how the sticky posts are intended to function? I’ve set aside this frustration for the moment. I suppose you could hack the blog template. I chose a different workaround, setting up category pages rather than a blog page. I’m not going to use the blog page until this is addressed. If you get it working the way you want, would you mind reporting back to the forum to share how you did it?

    Dan

    #12345
    Rajesh Kannan MJ
    Participant

    Hi,

    This could be a possible solution.

    The index.php should be modified as

    http://pastebin.com/MhAmZFkK

    Note the points I have added at line number 16 to 20 and line number 28.

    Please note that I am not a PHP coder. However, with online references, I have this snippet.

    Please check and give your feedback.

    Rajesh
    WordPress Themes

    #12365
    judyjudy
    Participant

    Hi all, I have created a first-pass solution for the blog page templates always showing the sticky post, featured image, landing page slider. (I presume all of the Pinboard blog templates do this.)

    You can see the result at my site:
    http://www.thegerddiet.com/gerd-news-stories/

    The home page (Welcome) still shows the slider.

    I’ve posted the code and brief instructions at my Tumblr blog:
    http://goo.gl/VVHhf
    or siteshack.tumblr.com.

    I hope this helps!

    #12391
    kingtutu
    Participant

    Try adding this to your CSS:

    .blog #slider {
    display: none;
    }

    #12423
    DanimalXC
    Participant

    Thanks Rajesh, Judy, and Kintutu for the suggestions!

    @Rajesh, I made the changes to the index.php code, to no effect. I’m a WordPress novice, but if I wanted to remove the slider posts from a *blog page* using your approach, wouldn’t I make edits to the blog php?

    @Judy, thank you for sharing this! Your version seems to be a good approach for those who want to create a workaround through a new blog category *while* exercising control over the layout. For me, simply assigning posts to the category (as you’ve done) and then making a menu link to that post category works without any custom templates, albeit with less control over layout (this is not a page in the sense that yours is). See my example here:

    http://danduett.com/category/writing


    @kingtutu
    , Your suggestion DOES remove the sticky posts from the Blog page provided that I select my intended blog page via Settings>Reading>Posts Page Displays. Example:

    http://danduett.com
    (Main page with slider, looking good)

    http://danduett.com/blog
    (No slider posts! Hooray!)

    When I make this change, the page title changes in the URL to the slightly annoying mashup of page name and site title without a space between (e.g. BlogDan Duett) but that problem is not a result of your solution. If anyone knows an easy fix to that, I’m all ears. I’m a WP novice and still haven’t found out how to customize page titles in the browser bar.

    Thanks again to all for their time and thoughts on this!

    Dan
    http://danduett.com

    #12424
    DanimalXC
    Participant

    Correction to my second-to-last paragraph: page title changes in *the browser bar*. Not the URL. When I don’t designate a particular page as the posts page, the title in the browser bar is simply the page name — Blog — rather than the page name/site name no space mishmash. Again, a separate issue only tangentially related to kingtutu’s solution.

    #12440
    DanimalXC
    Participant

    Fixed the above page title in browser bar issue with “SEO by Yoast” plug-in.

    #12662
    ccaaaac
    Participant

    @DanimalXC I have the same problem with the sticky showing at the top of my blog page. Have opted to go for @Judy solution by creating categories assigned to different blogs and linking via the menu directly. All works, except how do I get the category view to be full width instead of with a side bar?

    If I change ‘Theme Options > Layout’ to be by defaut ‘Full width’ I loose the side bars on the landing page.

    Is that what you have set your default layout to?

    Thanks,
    Aaron

    • This reply was modified 9 years, 7 months ago by ccaaaac.
    • This reply was modified 9 years, 7 months ago by ccaaaac.
    #12665
    DanimalXC
    Participant

    I have my default layout set to “No Sidebars” but edited the CSS as follows:

    “Try to add this in your css:

    .page-template-template-no-sidebars-php #wrapper,
    .page-template-template-blog-no-sidebars-php #wrapper,
    .page-template-template-portfolio-no-sidebars-php #wrapper { max-width:1200px; }

    The max-width of 1200px is only an example. You can adjust it to your needs.”

    I set mine to width of 1140, because I’m pretty sure that’s the default width for the theme. You can see my work in progress in the link below:

    Home – http://danduett.com
    Category 1 – http://danduett.com/category/travel
    Category 2 – http://danduett.com/category/writing

    Let me know if anything in this post isn’t clear!

    Dan

    #12666
    ccaaaac
    Participant

    Thanks, try this with an alteration for ‘Content / Sidebar’. Did not have the desired effect.

    The landing page requires the sidebars:
    http://www.stmaryschessington.org/new/

    The following page is desired to not have the side bars:
    http://www.stmaryschessington.org/new/category/thoughts/

    Thus, the later page is essentailly driving the landing page.

    Ideally I would like to overide the default layout on the category view, like you can when you create a static page.

    Guess I will have to keep t as is.

    Thanks for the effort.
    Aaron

    #12667
    DanimalXC
    Participant

    Sorry it didn’t work for you! This one’s outside of my knowledge set. Good luck!

    #13080
    mysticaluna
    Participant

    @kingtutu Thank you! Your CSS suggestion got rid of the header on my blog page.


    @danimalXC
    Thank you, too! Your suggestion to use the SEO plug-in got rid of that mash-up

    Cheers!

    Angie
    sixthstusedclothingco.com (will eventually be a different URL)

    #14128
    johnclassick
    Participant

    Isn’t there just a simple, straight-forward way to decide which categories of blogs you want to show on a certain page?

    #15231
    donotor
    Participant

    I have the same problem here. My main page is static with the slider on top, and my blog page always shows the sticky posts on top of other blog posts (which are meant only to show up in the slider).

    For the blog page i’m using the “4 columns template”, so i think i found out a solution customizing template-blog-four-col.php adding one single condition:

    Replace the following block:

    				
    <div class="entries">
      <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
        <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; ?>
    </div><!-- .entries -->
    

    adding the condition:

    
    <div class="entries">
      <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
        <?php if (!is_sticky()):?>
          <?php get_template_part( 'content', get_post_format() ); ?>
        <?php endif; ?>
      <?php endwhile; ?>
    </div><!-- .entries -->
    

    I hope it helps.

Viewing 15 posts - 16 through 30 (of 32 total)

You must be logged in to reply to this topic.