Post info and Comment weirdness

Community Forums Forums General Discussion Post info and Comment weirdness

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  purplepatriot 1 year ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23397

    purplepatriot
    Participant
    Post count: 34

    I’m not sure where to start.  I’ve got three categories – they have IDs = 6, 7 and 8.  I have two pages set to Blog template.  Page one is set to exclude category 6 (via query_args : cat=-6 added at bottom of that page), while page two only shows ID=6 (query_args : cat=6).  So far, so good.

    I want the post-info for Page 1 to be different than that on Page 2.  So, in functions.php I added the following:

    /** Customize the post info function for The Pastor's Study and Weekly Devotions */
    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    if( is_page_template() ) {
    if ( is_page(104) || in_category( '6' ) ) {
    $post_info = '[post_date] [post_comments] [post_edit]';
    }
    if ( is_page(106) || in_category( array( 7, 8 ) ) ) {
    $post_info = '[post_date] By [post_author_posts_link] [post_comments zero="No comments" 1="One comment" more="% comments"] [post_edit]';
    }
    }
    return $post_info;
    }

    Weirdness #1: On Page 1, there are 3 posts. The first two posts are from category ID=8 and display post-info as above. The third post is from category ID=7, but it does not have a link for the comments. If I click on the post title to show just that post, same thing. I’ve even ticked the box to specifically allow for comments.

    Weirdness #2: On Page 2 (containing category ID=6 posts), the post-info shows the post date, by author, and edit option. It is not as I programmed it above. I also have each of the individual posts on this page tick-marked to allow comments.

    I have Genesis Simple Edits enabled, and for Post Info, I have:

    “[post_date] By [post_author_posts_link] [post_comments zero="No comments" 1="One comment" more="% comments"] [post_edit]”

    I am at a loss.  Any ideas?  Thank you.


    Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
    “Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.

    #35016

    purplepatriot
    Participant
    Post count: 34

    Since I can no longer edit my original post, I need to provide two updates.  The Page 1 and Page 2 links above should now be (respectively)

    http://www.ibcwausau.org/resources/the-pastors-study

    and

    http://www.ibcwausau.org/resources/weekly-devotion

    Thanks!


    Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
    “Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.

    #35034

    essaysnark
    Participant
    Post count: 276

    **Totally** not an expert, but my suspicion is the “or” (||) in the two if(is_page(xxx)) statements — shouldn’t those be && instead?

    #35040

    purplepatriot
    Participant
    Post count: 34

    Hey essaysnark – thank you for the suggestion. =)

    Basically, the code says if it’s the page that shows all the posts from category 6 (i.e., pageid=104, which has Template set to ‘Blog’ and ‘query_args’ value of cat=’6′) OR a single post from category 6, don’t show the author. But, if it’s the page that shows all posts from categories 6 and 7 (i.e., pageid=106, which has Template set to ‘Blog’ and ‘query_args’ value of cat=’-6′) OR a single post from either category 6 or 7, then show the date, author and specific number of comments. So, I don’t want the ‘if’ statement to be true if both conditions are met, but rather when either is condition is met.


    Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
    “Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.

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

You must be logged in to reply to this topic.