Search Result for: Wordpress Category

Articles

WordPress migrating images problem

When moving a website from local to staging, a major problem was identified. Images that were used in content pages (POSTS) in WordPress were being broke. After looking through
Read More

Identify if your on the first Paginated page of home.php (default blog page)

Use this page to identify if you are on the first page of your blog
Read More

Use this code to reduce length of excerpt

Use the following code to reduce the length of the WordPress
Read More

Use the following function to get Post Slug in body class

//Page Slug Body Class function add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return
Read More

Use this code to hide text editor on certain pages or templates

<?php /** Hide editor on specific pages. */ add_action( 'admin_init', 'hide_editor' ); function hide_editor() { // Get the Post ID. $post_id = $_GET['post'] ? $_GET['post'] :
Read More

Simple function to list all Categories a single post is listed in

function listSinglePostCategories($post_id){ $wpcats = wp_get_post_categories($post_id); $cats = array(); foreach ($wpcats as $c) { $cats[] = get_cat_name( $c ); } $lister =
Read More

List categories with Posts (Using custom post types and custom taxonomies)

The following code easily lists a set of Categories (taxonomies or custom taxonomies) followed by a loop of posts that follow
Read More

Change the author of a post in WordPress

To change the author of a post first go to and open a post. Now open the “Screen options” that you find right at the top of the post edit page.   Now click the
Read More

Get post ID’s

Use the following code to get the post ID of a WordPress
Read More