get_post_format [ WordPress Function ]
get_post_format ( $post = null )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: set_post_format, get_post_format_link, get_post_format_slugs, get_post_format_string, has_post_format
Retrieve the format slug for a post
Source
<?php
function get_post_format( $post = null ) {
$post = get_post($post);
if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
return false;
$_format = get_the_terms( $post->ID, 'post_format' );
if ( empty( $_format ) )
return false;
$format = array_shift( $_format );
return ( str_replace('post-format-', '', $format->slug ) );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get post format « WordPress Codex
Description. Returns the post format of a post. This will usually be called in the the loop, but can be used anywhere if a post ID is provided.
codex.wordpress.org - WordPress › Support » Fatal error for function: get_post_format ()
You can see from the Codex link I posted that the get_post_format() function is part of WP 3.1. I just searched the 3.0.2 source code (including the bundled ...
wordpress.org - has_post_format() vs. get_post_format() - WordPress - Stack ...
Apr 8, 2011 ... get_post_format() returns the string value of the current post format type, which is useful in several ways. One of the most powerful is to call ...
wordpress.stackexchange.com - Duster and get_post_format() « WordPress.com Forums
Fatal error: Call to undefined function get_post_format() in .../duster/showcase. php on line 107. i don't think i did something wrong but i'm open ...
en.forums.wordpress.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- ambrosite on "Fatal error for function: get_post_format ()"
- jkeegan on "Fatal error for function: get_post_format ()"
- maxedleson on "Fatal error for function: get_post_format ()"
- jkeegan on "Fatal error for function: get_post_format ()"
- maxedleson on "Fatal error for function: get_post_format ()"
- jkeegan on "Fatal error for function: get_post_format ()"
- jknap968 on "Fatal error for function: get_post_format ()"
- ambrosite on "Fatal error for function: get_post_format ()"
- jknap968 on "Fatal error for function: get_post_format ()"
- ambrosite on "Fatal error for function: get_post_format ()"