Excerpts on Custom Blog Page/Full Post on Home Page

Community Forums Forums Design Tips and Tricks Excerpts on Custom Blog Page/Full Post on Home Page

This topic is: not resolved

This topic contains 9 replies, has 4 voices, and was last updated by  CarrieBYogini 1 year ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7585

    kilerb
    Participant
    Post count: 45

    Hi, I’ve went through a few posts on the old forum regarding this, and none of the solutions seem to be for my situation.  Here’s what I have.

    A main page (Splash page, which is a static page with the blog template activated and a query of cat=1) so it only shows that category.  Works fine.  I’d like to keep it showing the entire post.

    Then I have a 2nd page called “Blog” and it’s basically just a 2nd category only.  Use the menu to add that blog page with just the specific category.  I would like this one to only show excerpts.  Not the entire post.  I’ve tried adding the codes suggested in the old forums, but I think I’ve made this differently than they did because they didn’t work.  In this scenario, how could I make this work?

    Thanks!
    B

    #7797

    Jen Baumann
    Keymaster
    Post count: 315

    Can you provide a link to your site and in particular, which pages you want which scenario to apply to? Thanks.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #7798

    kilerb
    Participant
    Post count: 45

    http://lorasomoza.com/ …  Want full posts on the main page since it’s a podcast and want the play buttons to show.

    Just want excerpts under the blog tab…   http://lorasomoza.com/?cat=3

    Thanks!

    #7804

    Jen Baumann
    Keymaster
    Post count: 315

    Ok, so there’s a couple of things to address here.

    When you set the homepage to use the blog page template, that normally causes problems with pagination once you have enough posts to see that. So, I recommend against that. Instead, you can have a home.php that should solve all problems.

    Create a home.php and add this content:

    <?php
    /** Removes everything form post content **/
    remove_all_actions( 'genesis_post_content' );
    
    /**Add full content**/
    add_action( 'genesis_post_content', 'the_content' );
    /**use only category 1**/
    function child_before_loop () {
        global $query_string;		
        query_posts ($query_string . '&cat=1');
    }
    add_action('genesis_before_loop', 'child_before_loop');
    
    genesis();

    For the Podcast category, you'll probably want a function like this as well in functions.php

    add_action( 'genesis_before', 'child_conditional_actions' );
    function child_conditional_actions() {
        if( is_category( 1 ) ) {
           remove_all_actions( 'genesis_post_content' );
           add_action( 'genesis_post_content', 'the_content' );
        }
    }

    Then, make sure you set your Settings > Reading to display your latest posts and set the Theme Options to display either Excerpts or a Content Limit.

    Let me know how that works.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #8504

    kilerb
    Participant
    Post count: 45

    Hi there!  Just got back and am trying this now.

    I added the codes you suggested to home.php and functions.php and it still seems to show either excerpts or full posts on both pages, depending what’s selected in the Genesis area.

    Also, after trying that, I figured I had to change the “reading” area in settings to “show latest posts”  …  After doing that, I got this error below…  (I replaced the site with mydomain so it’s not on here a bunch of times.)

    Parse error: syntax error, unexpected ‘<’ in /nfs/c05/h04/mnt/160582/domains/mydomain.com/html/wp-content/themes/streamline/home.php on line 43

    Probably doing something dumb, but not sure what.  I left the code where you told me to put it.  Did I do something wrong?

    Thanks!

    B

    #8976

    kilerb
    Participant
    Post count: 45

    Not one to bump things, but I figured this might have gotten lost in the mix during the holidays!  :)  Happy New Year…  Would love to get this going today if you’re around.  I might have done something wrong, but I’m pretty sure I copy and pasted these snippets correctly.

    Thanks!

    #9181

    Jen Baumann
    Keymaster
    Post count: 315

    If you already had <?php at the top of home.php, then adding another will cause that. This should be a new home.php, not one that came with the theme.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #9202

    kilerb
    Participant
    Post count: 45

    Thanks :)

    #9649

    CathyT
    Participant
    Post count: 38

    I’m using this code, Jen, and my read more filters aren’t being executed… I’ve added the filter to a custom function like this in the home.php file:

    
    /**add some functions to run before loop**/
    add_action( 'genesis_before','dswp_run_before');
     function dswp_run_before() {
    
     /** Modify the Genesis content limit read more link */
     add_filter( 'get_the_content_more_link', 'bargainstobounty_read_more_link' );
     function bargainstobounty_read_more_link() {
     return '... <a class="more-link" href="' . get_permalink() . '">Read More &raquo;</a>';
     }
     /** Modify the WordPress read more link */
     add_filter( 'the_content_more_link', 'custom_read_more_link' );
     function custom_read_more_link() {
     return '<a class="more-link" href="' . get_permalink() . '">Read More &raquo;</a>';
     }
    }

    They’re still not showing though – no read-more links at all!

    #31432

    CarrieBYogini
    Participant
    Post count: 3

    I don’t ? think this “topic” covers my issue.  However maybe someone may have the answer!!

    My “sticky” post, I want the whole POST to show but only on the sticky not on the other blog posts.  Am I to input a code just on that post itself and if so, what would the code be?

    http://carriebcottrill.com

    The post that says “Namaste Creative Yoga Spirits” is the one I want to show the whole post; not to be changed unless I change it!!

    Anyone???

    Also I’m trying to make blocks on my “shoppe” page that looks like http://hibiscusmooncrystalacademy.com/shop/ !!

    Can you send me to a post that describes instructions for this or provide here?    I’ve been working at this soooo long and I just need to figure out these 2 things and I’ll be the happiest yogini!!

    Thanks sooo much!

    Carrie B!

     

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.