Show image exactly defined to a width

If $content_width is the problem, you could set it to something different if you’re viewing a single HQ post. function wpse99587_single_hq_post() { global $post; if( is_single() && in_category( ‘HQ’, $post->ID ) ){ global $content_width; $content_width = 900; } } add_action( ‘wp’, ‘wpse99587_single_hq_post’ ); // I dithered on where to hook this function; // if there’s … Read more

Display gallery on bottom after content

This is not bulletproof, but should work perfectly fine in most cases: class WPSE_105676_Gallery_First { private static $_gallery = ”, $_handler; public static function gallery( $attr ) { self::$_gallery .= is_callable( self::$_handler ) ? call_user_func( self::$_handler, $attr ) : ”; return ”; } public static function content( $text ) { $text .= self::$_gallery; self::$_gallery = … Read more

Get list of all custom tanonomy id

You can get it like this $terms = get_terms(“my_taxonomy”); $count = count($terms); if ( $count > 0 ) { echo “<ul>”; foreach ( $terms as $term ) { echo “<li>” . $term->name . “</li>”; } echo “</ul>”; } Otherwise you can also use like this $term_slug = get_query_var( ‘term’ ); $taxonomyName = get_query_var( ‘taxonomy’ ); … Read more

Where to add the permalink in this function?

Make use of the get_comment_link function in your foreach loop like so: foreach ($comments as $comment) { $output .= ‘<li><strong>’ . $comment->comment_author . ‘ said</strong> : “‘ . ‘<a href=”‘ . get_comment_link( $comment->comment_post_ID ) . ‘”>’ . strip_tags($comment->com_excerpt) . ‘…”</a></li>’; }