WordPress.org

Ready to get started?Download WordPress

Forums

Removing Post Info by Category (1 post)

  1. achase409
    Member
    Posted 1 year ago #

    I want to remove post info on all posts & category archives except for the 'News' category. I can do it easily in the CSS, but I am wondering why my PHP function is not accomplishing this task.

    Here is my code:

    add_action('genesis_before_post_content','remove_info_by_category');
    function remove_info_by_category() {
        if ( !is_category('News') || !in_category('News') ) {
            remove_action( 'genesis_before_post_content', 'genesis_post_info' );
        }
    }

    Any advice?

Topic Closed

This topic has been closed to new replies.

About this Topic