Post Format problem

What about add else { after get_template_part( ‘template-parts/content’, ‘video’); }? EDIT (1) : <?php /** * The template for displaying single posts. * * @package SN */ get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php if( has_post_format(‘video’)) { get_template_part( ‘template-parts/content’, ‘video’); }else{ ?> <div id=”content-wrapper”> <div id=”primary” class=”content-area”> <main id=”main” class=”site-main” role=”main”> … Read more

set_post_format called after wp_update_post when using bulk edit?

I was able to solve my problem by calling set_post_format in my save_post callback and making sure to check if its set and not equal to the “no change” option. Not sure if this is the best way to go, but it works. require( plugin_admin_dir . ‘plugin-sync.php’ ); add_action( ‘save_post’, ‘savethepost’, 2000); function savethepost($post_id) { … Read more

Archive of post format for Custom Post Type

There are no rewrite rules generated for post formats specific to post type. If you want pretty URLs for post type specific post formats, you need to add them yourself. // post_type doesn’t seem to work, // add rules to set custom query var function resource_post_formats_urls() { add_rewrite_rule( ‘resource/type/([^/]+)/?’, ‘index.php?post_format=$matches[1]&resource_only=1’, ‘top’ ); // pagination add_rewrite_rule( … Read more

Setting ‘post_format’

You can add an action to wp_insert_post(). The cool thing about it is the third parameter – $update, because it allows you to only set the post_format once, and you can change it later. This is necessary because the function wp_insert_post() is not only called on the creation, but also on update etc. add_action( ‘wp_insert_post’, … Read more

My custom theme text and content format

Themes can optionally use TinyMCE editor stylesheets via add_editor_style(). If properly implemented, editor styles will do a pretty good job at making the contents of the editor look the same way as content rendered on the front end of the site. Without editor styles, TinyMCE will use very basic styles which will not match the … 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

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