Forums

How to modify post formats in Twentyeleven (1 post)

  1. billionstrang
    Member
    Posted 8 months ago #

    I want to remove some post formats, and then add 'video' (in a child theme.) Codex says that if I call "add_theme_support() for post formats in a child theme it will override the existing list, not add to it." I did that by putting
    add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'quote', 'video' ) );
    in my child theme functions.php file, but nothing was overridden.

    So I made a function for it that works:

     	// Add support for a variety of post formats
    add_action ('after_setup_theme', 'mod_post_formats', 11);
    function mod_post_formats() {
    add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'quote', 'video' ) );
    }
    
    

    BUT: My question is, Is this the best and/or only way to override the post formats in a child theme? Codex didn't mention anything about making a function.

    Sorry if this seems clueless, but I don't fully understand the php, and I'm learning by trial and error.

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 8 months ago by billionstrang
  • This topic is not resolved
  • WordPress version: 3.2.1