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 -->