How to detect if some page template has been selected
sure it is possible. Just check the page meta field (assuming you’re in the loop): $template = get_post_meta( get_the_ID(), ‘_wp_page_template’, true );
sure it is possible. Just check the page meta field (assuming you’re in the loop): $template = get_post_meta( get_the_ID(), ‘_wp_page_template’, true );
You could create page templates within the theme. So, for example, for your About page: Create a “page-about.php” file in your theme Include the content there, but instead of using require use the normal WP functions (i.e. wp_head()) so all your plugins’ scripts and styles will load properly Create a Page in wp-admin with the … Read more
I found a solution. Installing the plugin, as mentioned above, Rewrite Rules Inspector indicated nothing wrong at all. However, installing the plugin No Category Base (WPML) and simply activated it, was enough to resolve the issue in every instance of it returning an error. I am afraid this might indicate something very wrong with my … Read more
Load custom post template
Pagination is not working in custom page template
You want to use get_page_templates function. See codex : https://developer.wordpress.org/reference/functions/get_page_templates/ get_page_templates(null, ‘your_post_type’);
The folder is just where Ocean WP’s developers chose to store its templates. It’s not something for you to do anything with. If you want to create your own custom template you need to create a Child Theme and create the template there. If you create or modify files in a theme they will be … Read more
Set page title in WordPress with PHP
You can hook before the template is loaded and output page content directly: function wpd_output_json_page(){ if( is_page( ‘Page Json’ ) ){ global $post; echo $post->post_content; die; } } add_action( ‘template_redirect’, ‘wpd_output_json_page’ );
wp_logout() not working after form submission