How to put a banner ad between post 1 and post 2 on homepage only

Register a widget, and call it on the front-page when the the_post action is called second time: add_action( ‘wp_loaded’, ‘wpse_80202_register_banner_widget’ ); function wpse_80202_register_banner_widget() { // used on the first page of main loop only register_sidebar( array ( ‘name’ => ‘Banner front-page ‘, ‘id’ => ‘frontpage_banner’, ‘before_widget’ => ‘<div class=”frontpage-banner”>’, ‘after_widget’ => ‘</div>’ ) ); } … Read more

How to show a post single post in page template

The »Template Hierarchy« doesn’t allow this per default. Inside your single.php template, you can call load_template(). This will allow you to simply include the template you need, based on the in_category() conditional tag. // inside single.php if ( in_category( ‘foo’ ) ) { load_template( get_stylesheet_directory().’foo_template.php’ ); } elseif ( in_category( ‘bar’ ) ) { load_template( … Read more

Add Adsense code in index.php

Here is a slight variation of my other answer. First we register two new widget areas, sidebars in WordPress-speak. add_action( ‘widgets_init’, ‘wpse_84250_register_ad_widgets’ ); function wpse_84250_register_ad_widgets() { // used on the first page of main loop only register_sidebar( array ( ‘name’ => ‘Ad Widget 1’, ‘id’ => ‘ad_widget_1’, ‘before_widget’ => ‘<div class=”frontpage-ads”>’, ‘after_widget’ => ‘</div>’ ) … Read more

Changing the homepage

To change the site Front Page to be a static Page: Go to Dashboard -> Settings -> Reading Change Front page displays from Your latest posts to A static page In the dropdown beneath this option, select the static Page to use as your Front Page. If you want to display your blog Posts somewhere, … Read more

Landing / Static HTML page

Just name the landing page file index.html and place it (and any assets) in the root directory, then add this to your .htaccess (assuming you’re using Apache): DirectoryIndex index.html index.php When accessing http://example.com, Apache will serve index.html. WordPress will scoop up all other requests with it’s rewrite rules.

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