WordPress.org

Forums

P2
Removing post format types (6 posts)

  1. wpfranner
    Member
    Posted 11 months ago #

    I am trying to remove all post format types but "post". The post format type "post" is all I want - both in back end and front end.

    There are several descriptions in forum posts and elsewhere on how to do this but they do not work anymore.

    Can you please help me?

  2. James Geiger
    Member
    Posted 11 months ago #

    Hi, try adding this in a child theme as well.

    // Use the after_setup_theme hook with a priority of 11 to load after the
    // parent theme, which will fire on the default priority of 10
    add_action( 'after_setup_theme', 'remove_post_formats', 11 ); 
    
    function remove_post_formats() {
    
        // Add this line to remove post formats
        remove_theme_support( 'post-formats');
    
    }

    @link: http://codex.wordpress.org/Function_Reference/remove_theme_support

  3. wpfranner
    Member
    Posted 11 months ago #

    Nope - didn't work. Thanks for your input though!

  4. Kathryn
    Automattic Happiness Engineer
    Posted 11 months ago #

    Try this child-theme function from my colleague Frank:

    function p2_child_remove_post_formats( $formats ) {
    	return array();
    }
    add_filter( 'p2_get_supported_post_formats', 'p2_child_remove_post_formats' );

    In your child theme's stylesheet, add this to remove the options from the front end:

    #post-types {
      display: none;
    }
  5. wpfranner
    Member
    Posted 11 months ago #

    Thanks Kathryn!!

    The post formats are now gone from both frontend and backend. So that is nice :-)

    Last problem remaining is that i still need to have the post format "Post" set as the only option instead of "Standard". The difference between the two is that there is a headline in the "Post" format but not in the "Standard".

    Any idea?

  6. valuser
    Member
    Posted 11 months ago #

Reply

You must log in to post.

About this Theme

About this Topic