Display different list of “Custom Templates” for each Custom Page Type
Display different list of “Custom Templates” for each Custom Page Type
Display different list of “Custom Templates” for each Custom Page Type
Rewrite single template permalink?
You can use below code. get_the_client(get_the_ID()); get_the_company(get_the_ID()); get_the_website(get_the_ID());
Try… function maybe_auth_redirect() { if ( is_page_template(‘my-template.php’) && ! is_user_logged_in() ) { auth_redirect(); } } add_action(‘template_redirect’, ‘maybe_auth_redirect’); https://developer.wordpress.org/reference/functions/is_page_template
So, it looks like I didn’t understand how a custom taxonomy works. http://joshrodg.com/hallmark/letters/tags/moore/ should be http://joshrodg.com/hallmark/tags/moore/ and http://joshrodg.com/hallmark/letters/tags/kenya/ should be http://joshrodg.com/hallmark/tags/kenya/. My mistake was that I expected the tags to be linked off my custom post type url, and not my main domain. I found the answer here: Archive template for taxonomy terms Thanks, Josh
They do not differ technically. These files exist in your theme directory and the template that loads is determined by the following: If you have a product with slug of dmc-12, then WordPress will first look for a file called single-product-dmc-12.php in the theme directory. If it finds it it will use that template when … Read more
Assuming post type is my-post-type. We can create a page template with custom query using WP_Query. Let’s say we create template-multier.php with the below code in the root directory of the active theme. <?php /* Template Name: Custom Post Type Archive */ //Custom header stuff here //Custom query for `my-post-type` $args = array( ‘post_type’ => … Read more
If you are using child theme. Add filter in the functions.php of child theme like this. add_filter(‘get_the_archive_title’,’wpse_224884_filter_archive_title’,10,1); function wpse_224884_filter_archive_title($title){ if ( is_category() ) { $title = sprintf( __( ‘%s’, ‘shaped-blog’ ), single_cat_title( ”, false ) ); } return $title; } Or Copy the entire function into functions.php function shaped_blog_archive_title( $before=””, $after=”” ) { if ( … Read more
You have no need callback function. Only reverse_top_level: true is find for what you want to do. Just remove ‘callback’ => ‘custom_comments_callback’, from your array. <?php wp_list_comments(array( ‘reverse_top_level’ => true, ‘avatar_size’ => 50, ‘reply_text’ => ‘Reply to this comment’ )); ?>
Answering my own question here, for anyone who might encounter this problem in the future. The cause for the right templates not loading was having uppercase letters in my template filename. Changing all characters in the filename to lowercase resolved the problem, and the templates are now being applied as they should. I’m still unsure … Read more