List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?

function show_subpages() { global $post; $subpages = wp_list_pages( array( ‘echo’ =>0, ‘title_li’ =>”, ‘depth’ =>2, ‘link_before’ => ‘&mdash; ‘, ‘child_of’ => ( $post->post_parent == 0 ? $post->ID : $post->post_parent), ‘exclude’ => ( $post->post_parent == 0 ? ” : $post->ID) )); if ( !empty($subpages) ) { echo ‘<ul id=”subpages” class=”wrapper”>’; echo $subpages; echo ‘</ul>’; } } … Read more

Multiple loops are not reset

At the end of your news.php, use wp_reset_query(). This will revert to the default query for that page. Hope this helps! Codex Function Reference for wp_reset_query()

How to add a php custom page to WordPress

Please refer to the Page Templates section of the Static Pages Codex entry. Essentially, you create a custom page template, named something like template-foobar.php, which will live in your Theme’s root directory, or in a one-deep sub-directory. Inside this template file, add the following: <?php /** * Template Name: Foobar */ get_header(); // YOUR CUSTOM … Read more

How to Display pages with a Custom Fields in one page

You can get pages with get_pages(), in the arguments you can provide a search query for post_meta, like for example: $args = array( ‘post_type’ => ‘page’, ‘meta_key’ => ‘section’, ‘meta_query’ => array( array( ‘key’ => ‘section’ ‘value’ => ‘surgery’ // here you could place get_the_title() ‘compare’ => ‘=’ ) ) ); $pages = get_pages( $args … Read more

Removing the TinyMCE editor for a given page template

You can try to hook on load-page hook instead of admin_init. It is supposed to be called only when a page is being edited, and then you should be able to use the global $post variable function hide_editor() { global $post; $template_file = get_post_meta($post->ID, ‘_wp_page_template’, true); if($template_file == ‘page-home.php’){ // template name here remove_post_type_support(‘page’, ‘editor’); … Read more