How to change home page only in WordPress

You should use custom template for this purpose. Create a new file homepage.php and write the below code. <?php /* Template Name: Homepage */ ?> <?php <!–Your code goes here–> ?> Then, create a new page in admin panel like HOME and in right sidebar select your “homepage” template you just created. Do not forget … Read more

Displaying posts on homepage – Template Page

The template tags (like the_content()) aren’t available when using get_posts. In order to make the template tags available, you have to make use of setup_postdata( $post ); Example: <?php $posts = get_posts(‘category_name=category-test’); foreach($posts as $post) { setup_postdata( $post ); the_title(); ?> <p><?php the_content(); ?></p> <?php } ?>

Function to limit number of custom post types on homepage – TwentyTen

This should do the trick: add_action( ‘pre_get_posts’, ‘add_tours_post_type_to_query’ ); function add_tours_post_type_to_query( $query ) { if ( is_home() && $query->is_main_query() ){ $query->set( ‘post_type’, array( ‘tours’ ) ); $query->set( ‘posts_per_page’, 1 ); } return $query; } For the future the Codex can be your friend. Exactly this is explained there.

Multiple posts/pages in one page?

More complex way I use it this way (I’m usually doing one page design, however the method of loading pages is still same). Fo Theme options, I’m using Option tree plugin where my clients could just checkbox which pages should appear there (it’s passed by it’s ID) and than I load it into the script. … Read more

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