How do I find the directory of a page template?

You can simply right click on your Template Select on the edit page, Inspect Element (on Chrome) then you can check the different options in the select like “page-template.php” as value and find your template file. 🙂 <select id=”inspector-select-control-0″ class=”components-select-control__input”> <option value=””>Default</option> <option value=”page-my-account.php”>My Account</option> </select> It should look like this with your own templates.

Change archive page template using pre_get_post

You corrected the filter hook name from archive-videos to template_include, but in the first function return $query; statement comes before add_filter(), so the filter is not added. add_action( ‘pre_get_posts’ ,’post_type_videos’ ); function post_type_videos( $query ) { if ( ! is_admin() && $query->is_post_type_archive( ‘videos_cpt’ ) && $query->is_main_query() ) { $query->set( ‘post_type’, ‘videos’ ); //set query arg … Read more

Creating a custom archive template that sorts post by date

I’ve taken the answer from here, where they are changing the order in a different way, but it should work for you. It uses the pre_get_posts hook to change the ordering for the archive page only. add_action( ‘pre_get_posts’, ‘my_change_sort_order’); function my_change_sort_order($query){ if(is_archive()): //If you wanted it for the archive of a custom post type use: … Read more

is_account_page() change to page slug

You could try to use the is_page() function – https://developer.wordpress.org/reference/functions/is_page/ The function signature accepts one parameter – $page (int|string|int[]|string[]) (Optional) Page ID, title, slug, or array of such to check against. Default value: ” if ( is_page(‘account’) ){ // do some code here }

Pagination of a WP_Query Loop in a child-page page template

Glad that you managed to figure out a solution, which yes, does work. But you could make it more selectively, i.e. target just the specific pages, by using is_single( ‘<parent slug>/<child slug>’ ), e.g. is_single( ‘family-law/success-stories’ ) in your case. Secondly, it’s not exactly the redirect_canonical hook which caused the (301) redirect on singular paginated … Read more

Visual Editor Templates

Short answer: kinda The visual editor is the open source Tiny MCE WYSIWYG editor. You can style it however you want (i.e. so that it presents the same colors and fonts as the finished posts and pages) by writing a stylesheet to do so and loading it with the add_editor_style hook. However, it sounds more … Read more

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