post_name empty after wp_insert_post

Firstly, you shouldn’t use post_category, because according to the wordpress codex wp_insert_post(): ‘post_category’ => [ array(, <…>) ] //post_category no longer exists, try wp_set_post_terms() for setting a post’s categories Secondly, if you want the post title to be your slug you shouldn’t need to use the post_name parameter, because it gets constructed from the title … Read more

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

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)