How to add HTML code on WordPress home page

Some time we want to show Some custom text or HTML code on home page. In this article we given tricks and steps to add HTML code on WordPress home page.

How to add HTML code on WordPress home page

  • First method

you need go to wordpress admin panel.Create page with home name. Add your HTML or custom text in that page.

Go to Setting->reading section. There is “Front page displays”  section. We can found following two radio box over there.

  • Your latest posts
  • A static page (select below)

Select “A static page (select below) ” radio box. Than from “Front page:” select box, select the Home page. That sit.

How to add HTML code on WordPress home page
How to add HTML code on WordPress home page
  • Second Method

If you want to add some different text or HTML code, than you need open functions.php file which you found in wordpress themes folders. Just copy and paste following code in that file.


<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php

if (is_home() {
echo "HTML CODE GOES HERE OR TEXT";

}

?>

Note: You need replace HTML code. I used sample text in code.

Have fun!

How to fetch Feedburner Subscriber Count in wordpress

We all are using the feedburner button in wordpress sites. In this article showing, How to fetch Feedburner Subscriber Count in wordpress website using our code.

How to fetch Feedburner Subscriber Count in wordpress

Just copy paste the following code in your sidebar.php file(This file you will find in your template folder.)

<?php

//You need to change the uri parameter to your website name
$whaturl=”http://api.feedburner.com/awareness/1.0/GetFeedData?uri=wordpressapi/ZoqV”;

//Initialize the Curl for using the feedburner api
$wordpressapi = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($wordpressapi, CURLOPT_RETURNTRANSFER, 1);

//Set the URL
curl_setopt($wordpressapi, CURLOPT_URL, $whaturl);

//fetching data
$data = curl_exec($wordpressapi);

//Closing connection
curl_close($wordpressapi);
$xml = new SimpleXMLElement($data);
$fbcount = $xml->feed->entry[‘circulation’];
echo $fbcount;
//end get cool feedburner count
?>

Echo $fbcount will print the feed Subscriber count.

add custom header to different categories in WordPress

wordpress tutorial for add custom header, footer, or sidebar for different categories in WordPress. we have given simple conditinal code which need to use in your theme file.

add custom header to different categories in WordPress

If you want to add the different header for each category then use the following code in your index.php where “get_header()” method is called.

Create the Header-new_category.php file and put your header code in that file as per requirement.

For sidebar use this code:


<?php if (is_category(‘new_category’)) {
get_header(' new_category ');
} else {
get_header();
} ?>

Create the Header-new_category.php file and put your header code in that file as per requirement.

For sidebar use this code:


<?php if (is_category('New_category')) {
get_sidebar('new_category');
} else {
get_sidebar();
} ?>

Create the sidebar-new_category.php file and put your sidebar code in that file as per requirement.

For Footer use this code:


<?php if (is_category('New_category')) {
get_footer('new_category');
} else {
get_footer();
} ?>

 

 

Create the footer-new_category.php file and put your footer code in that file as per requirement.

Cheat Sheets for creating WordPress Themes and Plugins

Here is the list of cheat sheets which are very useful when your developing new theme or plugin. For wordpress theme developer and plugin developers cheat sheets are very important. We collected the nice collection Cheat Sheets for creating WordPress Themes and Plugins.

Cheat Sheets for creating WordPress Themes and Plugins

WordPress Theme Development Checklist

Download PDF : Download Cheat Sheet »
Source : http://startbloggingonline.com

WordPress Theme Development Checklist

WordPress CheatSheet

Download PDF : Download Cheat Sheet
Source : andywibbels.com

WordPress CheatSheet

The WordPress Help Sheet

Download PDF : Download Cheat Sheet
Source : http://www.fylrr.com

The WordPress Help Sheet

WordPress SEO Cheat Sheet

Download PDF : Download Cheat Sheet
Source : tekka.de

Wordpress SEO Cheat Sheet

WordPress Template Tags

Download PDF : Download Cheat Sheet
View HTML Version : View HTML Cheat Sheet
Source : bueltge.de

WordPress Template Tags

WP Widget Cheat Sheet

Download PDF : Download Cheat Sheet
Source : bueltge.de

WP Widget Cheat Sheet

WordPress Loop

Download PDF : Download Cheat Sheet
Source : bueltge.de

WordPress Loop

WP Plugin API Cheat Sheet

Download PDF : Download Cheat Sheet
Source : bueltge.de

WP Plugin API Cheat Sheet

find replace content in post wordpress

Some times we need to change specific text in wordpress. Using mysql database query or PHPmyadmin interface, you can find replace content in post wordpress. We have given mysql query for replacing the content using database.

find replace content in post wordpress

Use this query for wordpress users


UPDATE wp_1_posts SET post_content = REPLACE(post_content, 'www.test.com', 'www.secondtest.com');

Use this query for wordpress

UPDATE wp_posts SET post_content = REPLACE(post_content, 'www.test.com', 'www.secondtest.com');

WordPress Theme Template Files List

Here is the list of files which are required in wordpress theme. Whenever you are creating the new theme for wordpress, make sure that following files are present in your theme.

WordPress Theme Template Files List

  • style.css

The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme.

  • index.php

The main template. If your Theme provides its own templates, index.php must be present.

  • comments.php

The comments template. If not present, comments.php from the “default” Theme is used.

  • comments-popup.php

The popup comments template. If not present, comments-popup.php from the “default” Theme is used.

  • home.php

The home page template.

  • single.php

The single post template. Used when a single post is queried. For this and all other query templates, index.php is used if the query template is not present.

  • page.php

The page template. Used when an individual Page is queried.

  • category.php

The category template. Used when a category is queried.

  • tag.php

The tag template. Used when a tag is queried.

  • taxonomy.php

The term template. Used when a term in a custom taxonomy is queried.

  • author.php

The author template. Used when an author is queried.

  • date.php

The date/time template. Used when a date or time is queried. Year, month, day, hour, minute, second.

  • archive.php

The archive template. Used when a category, author, or date is queried. Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.

  • search.php

The search results template. Used when a search is performed.

  • 404.php

The 404 Not Found template. Used when WordPress cannot find a post or page that matches the query.

How to show or exclude Certain Categories in a Menu – WordPress

If you want show only some categories in wordpress menu than use following command in header.php.

<ul style=”float:left; width:840px;”>
php wp_list_categories(‘orderby=name&include=5,4,8,9,52,65,35’); ?>
ul>

If you want exclude some categories in wordpress menu than use following command in header.php.

840px;”>
php wp_list_categories(‘orderby=name&exclude=5,4,8,9,52,65,35’); ?>
</ul>

Following Options we can use with “wp_list_categories” method.

<?php wp_list_categories( $args ); ?>

args = array(
'show_option_all' => ,
'orderby' => 'name',
'order' => 'ASC',
'show_last_update' => 0,
'style' => 'list',
'show_count' => 0,
'hide_empty' => 1,
'use_desc_for_title' => 1,
'child_of' => 0,
'feed' => ,
'feed_type' => ,
'feed_image' => ,
'exclude' => ,
'exclude_tree' => ,
'include' => ,
'current_category' => 0,
'hierarchical' => true,
'title_li' => __( 'Categories' ),
'number' => NULL,
'echo' => 1,
'depth' => 0 ); ?>

 

By default, the usage shows:

  • No link to all categories
  • Sorts the list of Categories by the Category name in ascending order
  • Does not show the last update (last updated post in each Category)
  • Displayed in an unordered list style
  • Does not show the post count
  • Displays only Categories with posts
  • Sets the title attribute to the Category Description
  • Is not restricted to the child_of any Category
  • No feed or feed image used
  • Does not exclude any Category and includes all Categories
  • Displays the active Category with the CSS Class-Suffix ‘ current-cat’
  • Shows the Categories in hierarchical indented fashion
  • Display Category as the heading over the list
  • No SQL LIMIT is imposed (‘number’ => 0 is not shown above)
  • Displays (echos) the categories
  • No limit to depth
  • All categories.

How to add flash intro in sites and flash with wordpress

If want to ingrate flex or flash with wordpress. Using following steps and code you can add the flash player or flex in your wordpress theme.

 

Many wp developer are looking for wordpress flash header, wordpress flash gallery, wordpress flash player, wordpress flash intro. They want to integrate flex or flash with wordpress. Using following steps and code you can add the flash player or flex in your wordpress theme.

flash with wordpress

 

Follow my steps to create flash intro in wordpress sites.

1. Create file named intro.php and just copy paste following code:

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

<?php

/*

Template Name: intro

*/

if (have_posts()) : while (have_posts()) : the_post();
the_content();
endwhile; endif;

?>

[/viral-lock]

2. Upload intro.php file in your active theme folder.

3. Login to wordpress admin area. Click on Pages- >Add new button

4. Page title shoule be “intro” and use html mode and copy paste the your flash intro code in that page.

flash with wordpress
flash with wordpress

5. In attribute section you will find the Template option. Choose the intro option and publish the page.

flash with wordpress
How to add the flash intro in wordpress sites, flash with wordpress

 

6. Go to Setting->Reading tab and Choose the Static page check box and select the “intro” option for “Front page” and click on save changes button. That sit

Here is some useful articles link from wordpress. If you want to show pdf in post on wordpress  and  add feedburner subscribe popup to wordpress. There all types of wordpress tutorial can be found in this site.

 

solution for plugins are not working on wordpress theme

solution for plugins are not working on wordpress theme. Whenever you developing the new theme. You need to add following code in your theme file.

solution for plugins are not working on wordpress theme

</p>
wp_head();

Goes in the HTML <head> element of a theme; header.php template. Example plugin use: add javascript code.

Usage: <?php do_action('wp_head'); ?>

-or- <?php wp_head(); ?>

wp_footer

Goes in the “footer” of a theme; footer.php template. Example plugin use: insert PHP code that needs to run after everything else, at the bottom of the footer.

Usage:


<tt><?php do_action('wp_footer'); ?></tt>

-or-

</tt>

<tt><?php wp_footer(); ?></tt>

wp_meta();

 

Typically goes in the <li>Meta</li> section of a theme's menu or sidebar; sidebar.php template. Example plugin use: include a rotating advertisement or a tag cloud.

Usage:


<tt><?php do_action('wp_meta'); ?></tt>

-or-

</tt>

<tt><?php wp_meta(); ?></tt>

comment_form

Goes in comments.php and comments-popup.php, directly before the comment form's closing tag (</form>). Example plugin use: display a comment preview.

Usage:

</tt>

<tt><?php do_action('comment_form', $post->ID); ?></tt>

Note: don’t forget to add wp_head, wp-footer and wp_meta methods in you theme.

How to set different layout for each category in WordPress

In this article we given full steps and code for How to set different layout for each category in WordPress. Which you need to use in your wordpress theme.

How to set different layout for each category in WordPress

Using following code you can able to set different layout for each category.

Just create the category.php file or already existed then open that file and use following code in that file.


<?php

if (is_category(10)) {

// looking for category 10 posts

include(TEMPLATEPATH . '/layout2.php');

// or you can use “get_cat_id(’category_name’)” instead of category id

} else {

// put this on every other category post

include(TEMPLATEPATH . '/layout1.php');

}

?>

Here we are calling the layout 2 for category 10.

Have fun!