Force template on page load

This question is quite difficult to understand. Do you mean you want to make generic template pages Programmatically? There are a few ways to do this. If you have a page built on the backend, you can create a file within your theme folder called page-{page-name}.php. For instance, for a page called about, you should … Read more

Read more button not working

From the Codex: Excerpts (teasers) can be shown on WordPress through two methods: The first, keeping the the_content() template tag and inserting a quicktag called more at your desired “cut-off” point when editing the post. The second, by replacing the the_content() template tag with the_excerpt(). If one of those conditions is met, and you are … Read more

Make default template two columns?

1. Add .php in wp-content/themes/ Write <?php /** * Template Name: <subpage-name>, left sidebar * Description: A one-colum template with left sidebar for <subpage-name> ONLY */ get_header(); ?> 2. Copy full-width page basic codes. 3. Add new div for <div id=”main” class=”<subpage-name>-right clearfix” role=”main”> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, … Read more

Page.php vs Single.php

Edit Based on this comment: commenting out comments_template works. The problem lies in the template markup in comments.php. The likely reason that you see it in some output and not others is likely because you’ve got comments enabled in one context, and not in the other. Try comparing single posts with comments enabled vs disabled, … Read more

load_textdomain won’t load my .mo file

I found the answer: load_textdomain( ‘site-map’, TEMPLATEPATH.’/partials/languages’ ); … gives the path of the folder containing the .mo file. but the path of every individual mo file should be used in its own load_textdomain instruction : load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-fr_FR.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-en_US.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-es_ES.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-ru_RU.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-de_DE.mo’); Shame on me it is a very obvious and … Read more

How to display page content and a list of posts on the same page?

php file add the following code snippet <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php the_title( ‘<h1>’, ‘</h1>’ ); ?> <?php the_content(); ?> <?php endwhile; // end of the loop. ?> <?php $post = array( ‘post_type’ => ‘post’, ‘order’ => ‘ASC’, ‘post_status’ => ‘publish’ ); $loop = new WP_Query( $post ); … Read more

Index template and Home page

Use home.php just as Sisir said. Copy the content from index.php to that file and you are all set. home.php tells wordpress that that page should be the homepage in a theme so no backend settings needs to be changed.