Attach a custom post type archive to a static page
Have you tried add_theme_support( ‘title-tag’ ); And remove the title tag from your theme, and call the wp_head() at proper place.And let wp handle the title tag for you.
Have you tried add_theme_support( ‘title-tag’ ); And remove the title tag from your theme, and call the wp_head() at proper place.And let wp handle the title tag for you.
After taking a look to themes code I realized that all those html parts I wanted where hardcoded on the themes files, so there wasn’t any nice way to retrieve those chunks of html I followed Strap1 comment and enabled my plugin to override my template, otherwise I parse the file page.php from the theme, … Read more
You can use the month parameter of WP_Query to get posts by month. For example, to get all posts published on March, ignoring year: <?php $the_query = new WP_Query( ‘monthnum=3’ ); echo ‘<ul>’; while ( $the_query->have_posts() ) { $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; } echo ‘</ul>’; wp_reset_postdata(); ?>
How to get Last post Id of custom post type in wordpress
change your $args array to the following $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 5, ‘tax_query’ => array( array( ‘taxonomy’ => ‘productcategories’, ‘terms’ => $term->name, ‘field’ => ‘name’ ), ), );
Post is not being published after clicking on Publish button in Custom Post Type
It turns out we had inadvertently created a single conventional category together with our dozen or so custom categories (this probably happened using the WP Ultimate CSV Importer which, for some of our imports, I think we’d filled in the category field hoping it would map to our custom category; it didn’t and we forgot … Read more
Just make sure that the code you have write in archive-{post_type}.php file or you can use ajax pagination if you need to use page template: Add this ‘has_archive’ => ‘page template’ when you register the custom post type
For the sorting, you are missing how you want to sort it. Use ‘order’ => ‘ASC’ or ‘order’ => ‘DESC’
It give a hook to init your function for the requirements. The hook {status}_{post_type} is your right hook. If this hook was fired, you can start your custom function to change the post type. For your custom post type “prototyp” use publish_prototyp. See also the codex about the hook, also the hook from old status … Read more