Removing post title on specific category

Community Forums Forums General Discussion Removing post title on specific category

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  SimplyAA 1 year, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #55299

    SimplyAA
    Participant
    Post count: 67

    Hi, I am trying to remove the titles on certain blog posts. I have one category that I don’t want them to show up. Here is an example http://getlevitin.com/consistency-is-key-to-competency/.
    Thank you


    http://getlevitin.com/consistency-is-key-to-competency/
    #55306

    braddalton
    Participant
    Post count: 10222

    Replace the 007 with the category i.d

    Note: This code uses the old XHTML hooks


    #56212

    SimplyAA
    Participant
    Post count: 67

    Hi Brad,

    Thanks for your response. Unfortunately when I try to put the above code in my functions. php it give me this error:

    Fatal error: Cannot redeclare child_remove_page_titles() (previously declared in /home/content/16/4888316/html/levitinu/wp-content/themes/education/functions.php:110) in /home/content/16/4888316/html/levitinu/wp-content/themes/education/functions.php on line 129

    I already have this code:

    add_action(‘get_header’, ‘child_remove_page_titles’);
    function child_remove_page_titles() {
    $pages = array( 28,329,320,16,22,327,324,420,658,475,929,151,1321 );
    if ( is_page($pages) ) {
    remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    }
    }

    that is working to remove on PAGES but when I enter a POST number it won’t work. What am I missing here?

    Thanks


    #56251

    braddalton
    Participant
    Post count: 10222

    Simply change the name of the function. You cannot use the same function name:
    [php]
    add_action(‘get_header’, ‘remove_page_titles’);
    function remove_page_titles() {
    if (in_category(’007′) ) {
    remove_action(‘genesis_post_title’, ‘genesis_do_post_title’);
    }
    }
    [/php]


    #60980

    SimplyAA
    Participant
    Post count: 67

    Thank you very much. This worked perfectly.


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

The topic ‘Removing post title on specific category’ is closed to new replies.