Custom page template for multiple pages

You can always make use of the page_template filter to tell WordPress to use a specific page template for all child pages of a certain parent. It is as easy as creating a special page template, lets call it page-wpse-person.php. Now it is as easy as including that template whenever a child page of people … Read more

Get the ID of the direct parent page

I’m assuming that you’re asking how to do it with code? (Doing it in backend is pretty easy – just try to edit parent page and see the ID in URL). So how to check post parent in code? It’s also very easy – direct parent is stored in post_parent property. If post has no … Read more

Pass data from one page to anothe file/page in wordpress

You can try to use functions.php to handle the form submission and send the data via AJAX. Add a hidden field in your form with the action to be taken (on functions.php): <input type=”hidden” name=”action” value=”save_contact”/> In you footer.php add the jQuery code to handle the AJAX request: jQuery(‘#your-form’).submit(ajaxSubmit); function ajaxSubmit(e){ e.preventDefault(); var formData = … Read more

Role can edit just one page [closed]

Adminimize does not remove menu items etc, it just keeps them visually hidden. In other words, your admin pages is still accessible. Add this code to your functions.php file: add_action(‘admin_menu’, ‘edit_trustees_page’); function edit_trustees_page() { global $submenu; $trustees_page_id = 1; //change this value $url = get_admin_url() . ‘post.php?post=” . $trustees_page_id . “&action=edit’; $submenu[‘index.php’][] = array( ‘Edit … Read more

Updated WordPress, now getting errors on site

I suspect this is already resolved in the plugin, but I added a check for the new function in wp-content/plugins/fusion-builder/shortcodes/fusion-image.php:285. if ( ! empty( $image_id ) && function_exists( ‘wp_image_add_srcset_and_sizes’ ) ) { $content = wp_image_add_srcset_and_sizes( $content, wp_get_attachment_metadata( (int) $image_id ), $image_id ); } elseif ( function_exists( ‘wp_make_content_images_responsive’ ) ) { $content = wp_make_content_images_responsive( $content ); … Read more

Dynamic Landing Page

The best solution here IMHO is to create a custom taxonomy named “highlights” or something similar. You can then create new terms for each landing page that you wish to create. The of of which would probably be “Blue Widgets”. You can then associate as many posts to the “Blue Widget” term as you wish. … Read more

Create a page that’s to not be indexed or accessible via slug

Why don’t you use is_page(id of the page) check with php and redirect them off that page to the main url? Example: if (is_page(22)) { //php redirect them to the main url } else { //normal template continues } EDIT: Just to be sure, you can use is_page_template check. if (is_page_template(templatename.php)) { //php redirect them … Read more

get_pages() as per custom menu order

I Have Found My Own Solution. I Tried To Get Page ID Of Each Custom Menu Item & Rendered Page Based On That ID. Reference : wp get nav menu items Like This… $menu_name=”primary-menu”; if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) { $menu = wp_get_nav_menu_object( $locations[ $menu_name ] … Read more