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

AJAX requests within templates

Security through obscurity isn’t a good pattern to follow. You have to have a URL to make XHR or JSONP calls. Anyone who knows anything about searching the DOM using developer tools, Firebug, etc… can easily find your remote script URL. To me, this is the wrong question to ask. The more relevant question to … 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.

WordPress -> PHPBB look a like

Simple:Press is what you are looking for. According to their Web site, they are “the number one forum plugin that integrates seamlessly into your WordPress website.” bbPress is another good one.

Show page title just from the first child-page in template

Use WP_Query class to do it: $the_query = new WP_Query( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ) ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2 class=”subpagetitle”> <a href=”https://wordpress.stackexchange.com/questions/55118/<?php the_permalink(); ?>” rel=”bookmark” title=”<?php the_title(); ?>”> <?php the_title(); ?> </a> </h2> <?php endwhile; // Reset Post Data wp_reset_postdata();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)