Custom formatting

That is one way to do it, and I have done that for certain technically challenges clients. It is quick and simple. It does add a query to the parent page, but that isn’t catastrophic. It would work fine if you have a few of these pages and aren’t adding or editing them a lot. … Read more

Displaying cf post formats with oembed

<?php if (strstr($audio, ‘<iframe’)) { echo $audio; } else { echo wp_oembed_get( get_post_meta($post->ID, ‘_format_audio_embed’, true) ); } ?> Of course, this would require that you get the custom field with the audio embed code or url into $audio 🙂 Edit – try: <?php $audio = get_post_meta($post->ID, ‘_format_audio_embed’, true); if (strstr($audio, ‘<iframe’)) { echo $audio; } … Read more

Mass post format changer?

Back-up your db Add this code to your functions.php file from your theme: $all_posts = get_posts(array( ‘numberposts’ => -1, ‘post_type’ => ‘post’, )); foreach($all_posts as $p) set_post_format($p->ID, ‘standard’); Refresh Remove the code Or with a SQL command: UPDATE `term_relationships` SET term_taxonomy_id = ‘standard_post_format_id’ WHERE term_taxonomy_id = ‘gallery_post_format_id’ Change standard_post_format_id and gallery_post_format_id with the IDs matching … Read more

Change standard post format metabox

The problem you are having here is that standard is not a post format. standard is just assigned to posts that does not have a post format assigned to it. You can also check in your db in wp_terms, there is no post-format-standard term. You can also do the following to print out a list … Read more

Post formats and template hierarchy

It is easy to make this work if your theme don’t support post formats Create a child theme add_theme_support for post formats Remove the loop from your template files and add replace it with get_template_part( ‘content’, get_post_format() );. Your template should look like this if ( have_posts() ) { // <- Not necessary in single.php … Read more

How to treat post formats?

If you are developing your own theme (as you have indicated in your question), depending on the level of coding you want to get into, you are probably better off using one. Having said that it is certainly possible to do so without them, but this is what you’re going to have to look at: … Read more

Paste from word not preserving formatting

Pasting from Office to WordPress is never a clean experience. There are two options: paste as you’re doing and clean up the code later (manually deleting the <strong> </strong> tags and other bugs), or do as Bas Grave suggested and strip all formatting, then use WP to reformat it. The reason is creating more space … Read more

How to display list of video post on video section?

I already found the solution. I’m using WP_Query as the solution. Here is the code: <?php // The Query $query = new WP_Query( array( ‘posts_per_page’ => 4, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array(‘post-format-video’), ‘operator’ => ‘IN’) ) ) ); if ( $query->have_posts() ) : while ( $query->have_posts() ) … Read more