0

I haven't used WP since 3.5 so forgive my rustiness. I am trying to customize a child theme of twenty fourteen for WP 3.9.1 to make it more like a corporate site rather than a magazine site.

My goal: For the marketing department to simply login, add a product (post) and select the matching post format.

In SLT3, I did a Find Advanced > In Parent Folder and duplicated the image custom post format code in taxonomy-post_format.php, languages/twentyfourteen.pot, inc/widgets.php and added a content-product.php with no luck.

In addition to the default Standard, Aside, Image, Video, Audio, Quote, Link and Gallery, how do I add more custom post formats e.g. products?

From content-product.php:

<?php
/**
 * The template for displaying posts in the product post format
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */
?>
...
        <div class="entry-meta">
            <span class="post-format">
                <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'product' ) ); ?>"><?php echo get_post_format_string( 'product' ); ?></a>

From widgets.php:

public function widget( $args, $instance ) {
    $format = $instance['format'];

    switch ( $format ) {
        case 'image':
            $format_string      = __( 'Images', 'twentyfourteen' );
            $format_string_more = __( 'More images', 'twentyfourteen' );
            break;
        ...
        case 'aside':
        default:
            $format_string      = __( 'Asides', 'twentyfourteen' );
            $format_string_more = __( 'More asides', 'twentyfourteen' );
            break;
        case 'product':
        default:
            $format_string      = __( 'Products', 'twentyfourteen' );
            $format_string_more = __( 'More products', 'twentyfourteen' );
            break;
    }

From twenty fourteen.pot:

#: inc/widgets.php:84 taxonomy-post_format.php:45
msgid "Products"
msgstr ""

#: inc/widgets.php:85
msgid "More products"
msgstr ""

From taxonomy-post_format.php:

<header class="archive-header">
                <h1 class="archive-title">
                    <?php
                        if ( is_tax( 'post_format', 'post-format-aside' ) ) :
                            _e( 'Asides', 'twentyfourteen' );

                        elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
                            _e( 'Images', 'twentyfourteen' );
                        ...
elseif ( is_tax( 'post_format', 'post-format-product' ) ) :
                            _e( 'Products', 'twentyfourteen' );

                        else :
                            _e( 'Archives', 'twentyfourteen' );

                        endif;
                    ?>
                </h1>
            </header><!-- .archive-header -->

Most closely related WPSE question here

The default Post Formats are Standard, Aside, Image, Video, Audio, Quote, Link and Gallery

2
  • 1
    Why don't you have a look at custom post types. I personally think that this will give you more options than post formats Jun 10, 2014 at 5:57
  • @PieterGoosen Can you Leave your comment as an answer so I can give you credit.
    – Danger14
    Jun 10, 2014 at 16:00

2 Answers 2

0

I would suggest that you have a look at custom post types.

You have more flexibility and much more options working with custom post types than with post formats.

1

You don't.

New formats cannot be introduced by themes or even plugins. The standardization of this list provides both compatibility between numerous themes and an avenue for external blogging tools to access this feature in a consistent fashion.

http://codex.wordpress.org/Post_Formats

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.