Filter the first from Quote Post Format

I finally found a solution that works. In case you need it, here it is: <?php if (has_post_format(‘quote’, $post->ID)) { $content = trim(get_the_content()); // Take the first quote from the content $quote_string = extract_from_string(‘<blockquote>’, ‘</blockquote>’, $content); // Make sure there’s a quote on the content if (!$quote_string == “”) { // Get the first quote … Read more

Target all posts that are NOT aside or link post formats

Edited: Now that I understand your question, try this… Place this above your title to enable the post_class function. <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> Then add </div> below your title (or excerpt, or wherever you want this special styling to end). Now, a special class will be added in which you can use … Read more

Custom Post Formats

You can’t create custom post-formats. What you could either do is have a post category called portfolio and then use the body/post class specific to that to control the display on the front end, as this is what post-formats are designed for, or go for a custom post type. Personally I go by the idea … Read more

Renaming post formats after Gutenberg

The situation with changing strings in the block editor is complicated. There’s 2 problems here: The list of post formats used by the block editor (Gutenberg) is not filterable using JavaScript hooks, just as the list is not filterable in PHP. The JavaScript translation functions used by the block editor do not have equivalents of … Read more

How do I remove the post format meta box?

That gets added because your theme supports post-formats. You can either use a plugin (or a child theme’s functions.php) file to hook into after_setup_theme late and remove theme support: <?php add_action(‘after_setup_theme’, ‘wpse65653_remove_formats’, 100); function wpse65653_remove_formats() { remove_theme_support(‘post-formats’); } Or look for the the line in your theme’s functions.php file: add_theme_support(‘post-formats’); and remove it. The first … Read more

What difference does it make if I enable support for video post format?

Couple of things to point out actually: It will add a class on post_class() so you can use different formatting via css. In the case of Post Formats, the taxonomy is post_format and the terms are post-format-{format}. i.e. taxonomy-post_format-post-format-link.php http://codex.wordpress.org/Template_Hierarchy In single.php file you can use conditionals to have complete different html for each post … Read more

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