Single Post Templates Doubt

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

Remove ” Browse Category : ” from Archive title

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

How can I display a list of pages and the template used by each?

You could try this quick piece of code, it doesnt output to array though. $args = array( ‘meta_key’ => ‘_wp_page_template’, ‘sort_column’ => ‘post_title’, ‘sort_order’ => ‘desc’); $templates = get_pages($args); foreach ( $templates as $template){ $templatePage = $template->meta_value; $templateName = $template->post_name; echo “Named Template: {$templateName} – – {$templatePage}\n”; }

How can I make is_page_template() workable in child theme?

Your first version of no_sidebar_style() looks fine: function no_sidebar_style(){ if (is_page_template(‘page-templates/page-nosidebar.php’)) { wp_enqueue_style( ‘no-sidebar-style’, get_stylesheet_directory_uri().’/css/no-sidebar.css’); } } add_action( ‘wp_enqueue_scripts’, ‘no_sidebar_style’, 19); For debugging, you can use get_page_template() to see the name of the template you’re viewing.

How can I modify this code to include the parent?

There are many way to do that and WordPress has some default functions to get that parent page. In fact there is a thing called post_parent in post object. However, you can use the below techniques I think- get_post_ancestors( $post ) function. Here $post is ID or object. Here you’ll find the documentation. You can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)