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

How to create an archive for all posts that do not have a post format?

For me I’d used a little different approach: use an endpoint to create an url like http://example.com/no-formats/ hooking pre_get_posts to set the proper query if needed filter template_include to force WP to use home.php instead of duplicating it No more. add_action(‘init’, ‘add_no_format_endpoint’); function add_no_format_endpoint() { add_rewrite_endpoint( ‘no-formats’, EP_ROOT ); } add_action(‘pre_get_posts’, ‘handle_no_format’); function handle_no_format( $q … Read more

Link Featured Thumb to Attachment Page, If Possible

Question 1: How do you link Featured Image to its Attachment Page In the loop: <?php if( has_post_thumbnail() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/52394/<?php echo get_attachment_link( get_post_thumbnail_id() ); ?>”> <?php the_post_thumbnail(); ?> </a> <?php endif; ?> Question 2: Post Format Templating Post formats are actually just a custom taxonomy with a fancy UI. Hence, you should … Read more

Add URL field to the link post format

In twentythirteen theme, the post format link is shown using the content-link.php file. The part that displays the link is: <h1 class=”entry-title”> <a href=”https://wordpress.stackexchange.com/questions/115376/<?php echo esc_url(twentythirteen_get_link_url());?>”><?php the_title(); ?></a> </h1> So the link is shown using the twentythirteen_get_link_url(); this function uses the wp function get_url_in_content() to get the first link in the content and shows it … Read more

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