WordPress excerpt for specific posts in category

Modify the callback and check the post category: function excerpt_read_more_link( $output ) { global $post; if ( in_category( ‘news’, $post ) ) return $output . ‘<a href=”‘. get_permalink( $post->ID ) . ‘”>more</a>’; return $output; } And you should prefix the function name. In its current form it is not safe enough.

How to display many photo albums related to category

To keep it simple and unique I would use a custom post type combined with a custom taxonomy called “Photos”. Registering a custom post type allows you to customize what the input is and the dashboard, along with making it easier to work with code wise, since it is separate from the default “posts”. You … Read more

Listing category

If you know the depth that you want you can add a depth parameter to $args $args = array( ‘orderby’ => ‘id’, ‘show_count’ => ‘0’, ‘child_of’ => $this_category->term_id, ‘use_desc_for_title’ => ‘0’, ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => ‘0’, ‘child_of’ => $this_category->term_id, ‘depth’ => 2 ); wp_list_categories($args); Experiment with that number if it isn’t what you want. … Read more

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