Blog posts for custom post type only
Blog posts for custom post type only
Blog posts for custom post type only
Your single.php is coded in a way that show all posts like archive, it needs to be modified. To fetch current post, try something like that instead: <?php get_header(); ?> <section id=”content”> <div class=”wrap-content blog-single”> <?php while ( have_posts() ) : the_post(); ?> <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <?php the_title( ‘<h1>’,'</h1>’ ); ?> … Read more
I think you forgot to add this to your query args. By adding this page parameter WP will show the posts that would normally show on page=x. Solution: // So that WordPress will know which page to show $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; // Our query args array. $args = array( … Read more
You can use this shortcode in your archives page: [catlist id=7] You can find “id” on the url of category
Loop filtering Custom Post Types and/or Categories
Allow add new post access to custom post but not wp post for some role
Easy way: use this plugin https://wordpress.org/plugins/user-role-editor/ More complicated way: You can use functions.php to add all of the custom capabilities to a specific roles. But ofc you need a name of these capabilities. This code is usefull if you want to add X same capabilities to X roles. Add to functions.php function wphm_add_custom_capabilities_to_roles($roles, $capabilities) { … Read more
How to include term custom meta into the custom taxonomy term permalink structure
I get a way to override this problem. by using “add_action” I can able to achieve my goal. add_action(“load-edit.php”, ‘block_listing_page’); //– Block user to access post listing page function block_listing_page() { if ($_GET[“post_type”] == “your_custom_post_type”) { $args = array(‘post_type’ => ‘your_custom_post_type’, ‘post_status’ => ‘publish’); $galleryPosts = get_posts($args); if (!empty($galleryPosts) && count($galleryPosts) > 0) { wp_redirect(“post.php?post=” … Read more
Remove this: // Administration: Teach wordpress to make the column sortable function anco_project_year_column_orderby( $vars ) { if ( isset( $vars[‘orderby’] ) && ‘anco_project_year_from’ == $vars[‘orderby’] ) { $vars = array_merge( $vars, array( ‘meta_key’ => ‘anco_project_year_from’, ‘orderby’ => ‘meta_value_num’ ) ); } else if ( isset( $vars[‘orderby’] ) && ‘anco_project_year_to’ == $vars[‘orderby’] ) { $vars = … Read more