Get the Current Page Number

In a situation where one has 20 posts per page. I would like to get the current page number in order to make some nice page links at the bottom. How do you get the current page. I tried this <?php echo ‘(Page ‘.$page.’ of ‘.$numpages.’)’; ?> and it just says page 1 of 1 … Read more

Getting only direct child pages in WordPress with get_pages

I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? PHP Source: $args = array( ‘child_of’ => $post->ID, ‘parent ‘ => $post->ID, ‘hierarchical’ => 0, ‘sort_column’ => ‘menu_order’, ‘sort_order’ => ‘asc’ ); $mypages = get_pages( $args ); foreach( $mypages as $post … Read more

Custom templates not showing up in template dropdown

I’ve got some problems with templates in WordPress (multisite). I’ve created a file in the root of my child-theme folder (template-test.php) <?php /** * Template Name: Test template * */ ?> <?php get_header(); ?> <?php get_footer(); ?> This template is not showing up in the templates dropdown when creating a new page, or editing an … Read more

Determine if page is the Posts Page

On the Reading Settings page you can set a “Front Page” and a “Posts Page”. You can check whether the current page is_front_page(); Is there a similar function for the “Posts Page”. I have noticed that is_page(); does not work for this special page. Thanks 6 is_home() checks for the “Posts Page”, despite the somewhat … Read more

Contact Form on WordPress Sites?

How does one go about building a page in wordpress that contains a contact form full of custom fields, boxes, inputs, etc. completely determined by the author of the site. It seems odd that wordpress currently lacks this feature, but knowing the wordpress community, it’s unlikely that we must do without. 10 Contact Form 7 … Read more