Taxonomy count per Post type

I needed to get the number of post per type per term so i created this small function: function get_term_post_count_by_type($term,$taxonomy,$type){ $args = array( ‘fields’ =>’ids’, //we don’t really need all post data so just id wil do fine. ‘posts_per_page’ => -1, //-1 to get all post ‘post_type’ => $type, ‘tax_query’ => array( array( ‘taxonomy’ => … Read more

How to change permalinks to taxonomy and post type’s posts

Go to the permalinks setting in the wordpress settings page and change the permalink structure to this. https://mysite.com/%category%/%postname%/ And now add this code in your .htaccess file to achieve that permalink structure. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

Function not pulling image or text from custom post type

Try this way, may help you. I just fetch from a specific post ‘s image from a specific Post Type called “gameshowwarriorsw”. $gameShowWarriorsWorld = new WP_Query( ‘post_type=gameshowwarriorsw&orderby=date&order=DESC&p=371’ ); while ($gameShowWarriorsWorld->have_posts()) : $gameShowWarriorsWorld->the_post(); $postTitle = get_the_title(); $postid = get_the_id(); $postContent = get_the_content(); ?> <li> <a href=”#” onclick=”return get_inzenwarriorhero(<?php echo $postid ; ?>);”> <?php the_post_thumbnail(array(219,143)); ?> </a> … Read more

Admin menu post type

Yes you can do that. Use function add_menu_page http://codex.wordpress.org/Function_Reference/add_menu_page to add parent “All post types”, then use add_submenu_page http://codex.wordpress.org/Function_Reference/add_submenu_page to add pages to parent page: add_action( ‘admin_menu’, ‘my_custom_menu_page’ ); function my_custom_menu_page() { $slug = ‘all-post’; add_menu_page( ‘All post types’, ‘All post types’, ‘edit_posts’, $slug, ‘__return_true’ ); foreach( array( ‘post’, ‘page’, ‘foo’, ‘bar’ ) as $post_type … Read more