Password Protect Pages Not Working

Replace all of this: $my_postid = get_page( $page_id );//This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters(‘the_content’, $content); //$content = str_replace(‘]]>’, ‘]]>’, $content); echo $content; …with this: the_content();

How do i create a list-posts-page?

Assuming you’re only trying to display your blog posts index on a page other than the front page (i.e. because you’ve assigned a static page as your site front page), you shouldn’t need to do anything special. Refer to the Codex for step-by-step instructions for creating a static front page and separate page for your … Read more

How to query for a page, get data, then query for child pages of that page

I don’t understand the distinction you are making between ‘sublevel’ query and ‘toplevel’ query, but this is how I pull children for a page. $children = get_children( array( ‘post_parent’ => $servid, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ )); ?> Or… $page_children = get_pages( array( ‘child_of’ => $post->ID, ‘post_type’ => … Read more

Page header menu links change

Note that you’re using a Custom Nav Menu, meaning that the contents of the menu can be customized. The easiest solution is simply to: remove the current “Our Doctors” page from the menu add your desired page to the menu edit the menu item to change the displayed title to “Our Doctors” save the menu

Main menu navigation links and new pages

Templates can all have unique code, and your template may or may not support Custom Menus. I would find out if you can add custom menus through your Appearance > Menus tab in the admin area. If you can’t, all new pages you add from the Pages tab will most likely end up in that … Read more

Pagination for normal (standard) posts on a page with a custom loop?

get_pagination_links is looking at $wp_query, whereas you want pagination for your query object named $loop. So instead, use paginate_links Something similar to this code, which is based on get_pagination_links, alebit with wp-query swapped out for your loop query object: $endsize = $midsize = 1; $type=”plain”; $loop->query_vars[‘paged’] > 1 ? $current = $loop->query_vars[‘paged’] : $current = … Read more

Next Page & Previous Page links – skipping a single page – how?

I just tried this and it works for me. Given that you would like to exclude page id 4 this is the code you are looking for. <?php $pagelist = get_pages(‘sort_column=menu_order&sort_order=asc&exclude=4’); $pages = array(); foreach ($pagelist as $page) { $pages[] += $page->ID; } $current = array_search($post->ID, $pages); $prevID = $pages[$current-1]; $nextID = $pages[$current+1]; ?> <div … Read more

Using Posts Like a Page

Use pages for pages and posts for posts. Both post types are specialized for their use case. They use different permalink settings and list tables. The number of pages is not limited. I have seen site with more than 50.000 pages running smooth. In earlier days, the permalink parsing for pages was slow under some … Read more