Specific Post Format Image Thumbnail

From your comment: This is all I meant: add_image_size( ‘index-thumb’, 640, 250, true ); add_image_size( ‘image-format’, 630, 9999, true ); So, let’s assume you create custom image sizes for gallery and video (as well as a “default” size, which we’ll call standard), perhaps like so: <?php add_image_size( ‘index-standard’, 640, 250, true ); add_image_size( ‘image-gallery’, 630, … Read more

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

Filter image and text from post format

I’m pretty sure you’d define the custom post formats in functions.php, then they’d reference their own PHP file which contains the loop you’d need. So for example, Text format would go to post-text.php, Image format post-image.php, etc. You could add your match filters into a function within functions.php, and then call the function from within … Read more

Convert many posts from having a specific meta_key to use a post_format

After much reading, i realized that it would be more easily done using the WordPress API, so i baked out this little script. Simply add it to your theme’s functions.php then run it once. When done, remove it. function convertGalleries($test){ $galleries = get_posts(array( ‘meta_key’ => ‘custom_post_template’, ‘post_status’ => array( ‘any’ ),’posts_per_page’=>-1 )); if($test){ return count($galleries); … Read more

How can I add WordPress Audio Player as featured audio in Audio Blog Posts?

so I took a look at your updated code, and it looks like where you’re writing: $audio_url = get_post_meta($post->ID, ‘$key’, true); //this is getting your custom field url You forgot to replace ‘$key’ with the actual string name of the meta you’re looking for, which judging from your functions, is called ‘link’. So I edited … Read more