Display posts for a single post format

The post format taxonomy: The post format is a default taxonomy, registered with: register_taxonomy( ‘post_format’, ‘post’, array( ‘public’ => true, ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Format’, ‘post format’ ), ‘singular_name’ => _x( ‘Format’, ‘post format’ ), ), ‘query_var’ => true, ‘rewrite’ => $rewrite[‘post_format’], ‘show_ui’ => false, ‘_builtin’ => true, ‘show_in_nav_menus’ => … Read more

strip only specific tags (like ), but keep other tags (like )

You’d better never disable those actions (what you say). Instead, insert add_filter(‘the_content’, ‘MyFilter’, 88 ); and create such function: function MyFilter($content){ $tags = array( ‘p’, ‘span’); /////////////////////////////////////////////////// ///////// HERE INSERT ANY OF BELOW CODE ////////// /////////////////////////////////////////////////// return $content; } ======== METHOD 1 ========= $content= preg_replace( ‘#<(‘ . implode( ‘|’, $tags) . ‘)(.*|)?>#si’, ”, $content); $content= … Read more

Download external images if post is publish

Scheduled posts don’t trigger publish_post, only updating the post itself will do that. Add an action for future_to_publish, see the reference on post status transitions. I don’t believe that you’ll have access to the user-object in that case, so you might want to refactor that. Alternatively, just get the images when the user saves the … Read more

Can we completely remove the WordPress Sitemaps (WordPress 5.5)?

Disabling the sitemap is easy, just add this line to your functions.php: add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); Removing specific posts goes like this: add_filter( ‘wp_sitemaps_posts_query_args’, function( $args, $post_type ) { if ( ‘post’ !== $post_type ) { return $args; } $args[‘post__not_in’] = isset( $args[‘post__not_in’] ) ? $args[‘post__not_in’] : array(); $args[‘post__not_in’][] = 123; // 123 is the … Read more

getting video dimensions

php-flvinfo and php-mp4info are php classes for reading flv and mp4 metadata. you could read it on the fly, or it may be possible to hook a save to get this info in the db somewhere.

Post Format Archive template name for theme folder?

Well…. for querying, formats are a taxonomy parameter…so that should work…. http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters Lemme loook… And yep, here’s how that works http://codex.wordpress.org/Template_Hierarchy#Custom_Taxonomies_display taxonomy-post_format-post-format-link.php

$post->ID not working

Your WP_Query loop is incomplete. Your not checking if any posts were actually found before looping, nor are you presenting a message to show none were found, nor are you cleaning up afterwards. You’re also using the ‘other’ syntax that breaks brace matching in IDEs, making your life harder. Try adding global $post; like this: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)