Select Page
  • Facebook
  • Twitter
  • Google+
  • Pinterest

Image Source:

Just yesterday I was thinking if in WordPress  using its codex we can query post, categories, post in different categories, recent post and etc… But I couldn’t find examples how to query a page and finally I saw one that totally works, sadly I can’t remember the url but kudos to the original source.

 $page = new WP_Query('pagename=home'); while ($page->have_posts()) : $page->the_post(); $do_not_duplicate = $post->ID; ?>
 <div class="headline_area">
 <h1><?php the_title(); ?></h1>
 <div class="format_text">
 <p><?php the_content(); ?></p>
 <?php endwhile; ?>

What are the advantages of doing this?

What if you created a custom template for your home page and half of that page is text. So you will have to code the text manually inside the PHP file. Now this is no trouble for web developers, everyday they read and write this source codes but for end users it might be a little bit confusing and overwhelming.

Now there are 2 types of clients or end users

The leave it to the expert type


The you teach me so I can do it next time type

The first type will rely on you for changes on their websites most of the time, even adding or posting a blog they will call for your help, now the big problem is not the first type but the second type, they will want to do some changes themselves they will try to understand and modify the source codes and the end result is that the site is messed up and that time they will call for you again.

To help client’s save more instead of calling a developer every time they need changes and to save the time going back and forth fixing the site, make them use WordPress’s user friendly dashboard which is very easy to use if they need some changes done, they can edit a page using the text editor and basically whatever they do to the page it will reflect to the custom template.


Pin It on Pinterest

Share This