Can I assign a Folder for Post Formats, without it affecting WordPress’ fallback/hierarchical system?

In general, “bad practice” is so common in the wordpress ecosystem, you will have to do something really bad for anyone to actually signal you out for doing it 😉 If you are the developer and maintainer of the theme, you should develop it in a way which will be easy for you to maintain … Read more

display post format text in loop

get_post_format() returns the post format slug for either the current post, when used inside a loop, or a given post, when a WP_Post object or an integer post ID is passed to it as a parameter. So, if you’re using the function in a posts loop, then you can use it like this, while ( … Read more

How to display all posts not in a post_format

It didn’t work because your tax query is missing the operator which should be set to NOT IN. So just add it like so: ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-‘ . $post_format ), ‘operator’ => ‘NOT IN’, ) ), And please, avoid using query_posts() — use new … Read more

Almost Done… Post Format Code

You can utilize the WordPress function get_template_part(); Create several template files in your theme directory called content-POST_FORMAT_TYPE.php – Example: content-gallery.php and content-chat.php if(has_post_format(‘gallery’)) get_template_part(‘content’, ‘gallery’); elseif(has_post_format(‘chat’) get_template_part(‘content’, ‘chat’); else the_content(); This approach makes your code blocks reusable in multiple templates. Hope this helps you out.

How do I get standard posts to open up in their own template when using get_template_part()?

There’s actually nothing to fix. In Twenty Eleven, this is used in index.php: <?php get_template_part( ‘content’, get_post_format() ); ?> …and this is used in single.php: <?php get_template_part( ‘content’, ‘single’ ); ?> The design intent here is that all posts, regardless of post format, will display the same in single-post view, but that posts with defined … Read more

How can I prevent posts with no title showing up in my query?

Please find below a quick solution to your problem first query for all empty titles place the result in an array query again for post__not_in see below sample code $query = new WP_Query(‘post_title=\’\”); $a_empty_titles = array(); while($query->have_posts()){ $query->the_post(); array_push( $a_empty_titles ,$query->post->ID); } wp_reset_postdata(); wp_reset_query(); echo count($a_empty_titles); $query = new WP_Query( array( ‘post__not_in’ => $a_empty_titles ) … Read more

How to make the ‘delete’ button inactive on some categories?

WordPress uses the WP_List_Table class, or some extension of it, to generate those lists. In this case, it is the WP_Terms_List_Table class. That class contains a filter called {$taxonomy}_row_actions. add_filter( ‘category_row_actions’, function($actions, $tag) { $no_del = array(11,22,33); if (in_array($tag->term_id,$no_del)) { unset($actions[‘delete’]); } return $actions; }, 10,2 );

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