Are page/post IDs unique across a whole network?
Nope, they aren’t unique. So yes – you’d have to check current site and do that…. or use a theme with a custom menu?
Nope, they aren’t unique. So yes – you’d have to check current site and do that…. or use a theme with a custom menu?
If a page won’t work without a specific template, I would just remove the need for them to select a template. Filter template_include and select the template based on the requested page: function wpse50455_template_include( $template ) { // check if it’s a page if ( is_page() ): $this_page_id = get_query_var( ‘page_id’ ); // check for … Read more
the codex has exacly what you need: get_page_by_title() Example $page = get_page_by_title( ‘About’ ); $the_excerpt = $page->post_excerpt; or $page = get_page_by_path( ‘parent-page/sub-page’ );
WordPress listens to both $_GET and $_POST when parsing a request. If your form input names are conflicting with native query parameters, you’ll send WordPress on a wild goose chase (and most likely end up with a 404). For your leisure, I’ve kindly listed them here – if any one of your form inputs uses … Read more
The page template for custom post type is not saved because it is checking whether the post type is “page” – it is not implemented for custom post types yet. The drop-down for the page templates was completely removed in 3.1. This is my way how to deal with it: /* Define the custom box … Read more
Here is a solution to remove that metabox from the edit page – this solution also assumes that the editors don’t have access to edit themes. add_action( ‘admin_menu’, ‘restrict_access’ ); function restrict_access() { if(!current_user_can(‘edit_themes’)){ remove_meta_box( ‘pageparentdiv’, ‘page’,’normal’ ); } } Hope this helps
Use wp_enqueue_scripts instead on init. This will ensure you the template is already loaded. add_action(‘wp_enqueue_scripts’, ‘maps_scripts’); Or you try to check the template using get_page_template_slug() instead of is_page_template: $tmp = get_page_template_slug($post_id); // provide page/post ID if(‘page-about.php’ == $tmp) { // enqueue scripts here } Note that you don’t need to register scripts before enqueueing them. … Read more
As I understand it, you can’t use Page Templates that way; you need to edit your index.php file instead. See this chart for more detail on how the hierarchy works and this post for a detailed explanation. By specifying “Blog” as the “posts page” on the Settings > Reading tab, you are telling WordPress “this … Read more
Answer remade. The original was a wild idea… The solution is the same as the one posted by Rarst in the question linked How to *remove* a parent theme page template from a child theme? Difference being the admin_head hook. And a check for only running in edit-page and not in edit-post or edit-custom_post_type, as … Read more
Your paths should be: /wp-content/themes/gt3-wp-pure/page-templates/ … instead of: public_html/wp-content/themes/gt3-wp-pure/page-templates/