Display Notification Bar on Header on Certain Post Count

A simple way to achieve this would be to do something like the following; <?php $user_id = get_current_user_id(); $post_count = count_user_posts($user_id); if ($post_count >= 50 && $post_count < 100) { // Congratulations you have submitted 50 posts! } elseif ($post_count >= 100) { // etc etc… } else { // do something else, or nothing. … Read more

get_the_category listing in hierarchial order

Use wp_list_categories instead, <?php $args = array( ‘hierarchical’ => true, ‘child_of’ => 42, //parent category ‘hide_empty’ => 1, //hide empty categories (set to 0 to show) ); wp_list_categories($args); ?> A full list of parameters for wp_list_categories can be found HERE As you can see its highly customizable simply by adding extra arguements to the array … Read more

Trying to alter the post_content through the_post

It seems you’re actually looking for the the_content filter. add_filter(‘the_content’, ‘modify_content’); function modify_content($content) { global $post; if ($post->ID != $desired_id) return $content; $modified_content = /* modify content here */; return $modified_content; }