Why doesn’t this work?! <?php echo get_post_format_link('standard');?>
🙁 Any hints? All the other formats work.
Why doesn’t this work?! <?php echo get_post_format_link('standard');?>
🙁 Any hints? All the other formats work.
You must be logged in to post a comment.
Put this in your function.php
More information here.
from
http://www.tristarwebdesign.co.uk/blog/wordpress/query-by-post-format-in-wordpress/
When you assign a non-Standard post format to a post, a record gets added to the wp_term_relationships table. This record contains your post number and the term_taxonomy_id, which joins via wp_term_relationships to the post format in wp_terms. When you assign a Standard post format to a post, no record for post format is added to wp_term_relationships. If it was previously assigned another post format and changed to Standard, the record is removed from wp_term_relationships. Unfortunately, get_post_format_link relies on having that record in wp_term_relationships, so won’t work with Standard post format.
For example, when I changed a post’s post format to image, a record was added to wp_term_relationships, which eventually pointed to wp_terms >> post-format-image. When I changed the post’s post format to Standard, this record disappeared. In WP’s codebase, get_post_format_link uses get_term_by(‘slug’, ‘post-format-‘ . $format, ‘post_format’ ), and with the missing related post format record for Standard, we all lose. 😀
This might answer your original question of why it doesn’t work. I wish that I could offer a slick solution, especially given your immensely helpful WordPress posts!