Tricks/Techniques to Develop the WordPress Sites

Basic Tricks/Techniques to Develop the

WordPress Website!


Sites

1. Template Files


> Style.css

> Index.php

> Single.php

> Archive.php

> Searchform.php

> Search.php

> 404.php

> Comments.php

> Footer.php

> Header.php

> Sidebar.php

> Page.php



2. General Snippets for Header


<?php bloginfo(‘name’); ?>

<?php wp_title(); ?>

<?php bloginfo(‘stylesheet_url’); ?>

<?php bloginfo(‘pingback_url’); ?>

<?php bloginfo(‘template_url’); ?>

<?php bloginfo(‘version’); ?>

<?php bloginfo(‘atom_url’); ?>

<?php bloginfo(‘rss2_url’); ?>

<?php bloginfo(‘url’); ?>

<?php bloginfo(‘name’); ?>

<?php bloginfo(‘html_type’); ?>

<?php bloginfo(‘charset’); ?>



3. Snippets for Templates


<?php the_content(); ?>

<?php if(have_posts()) : ?>

<?php while(have_posts()) : the_post(); ?>

<?php endwhile; ?>

<?php endif; ?>

<?php get_header(); ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

<?php the_time(‘m-d-y’) ?>

<?php comments_popup_link(); ?>

<?php the_title(); ?>

<?php the_permalink() ?>

<?php the_category(‘, ‘) ?>

<?php the_author(); ?>

<?php the_ID(); ?>

<?php edit_post_link(); ?>

<?php get_links_list(); ?>

<?php comments_template(); ?>

<?php wp_list_pages(); ?>

<?php wp_list_cats(); ?>

<?php next_post_link(‘ %link ‘) ?>

<?php previous_post_link(‘%link’) ?>

<?php get_calendar(); ?>

<?php wp_get_archives() ?>

<?php posts_nav_link(); ?>

<?php bloginfo(’description’); ?>

<?php wp_tag_cloud(‘smallest=1&largest=9&’); ?>

<?php if ( is_category(’15′) ) {
<link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/cat-15.css”
type=”text/css” media=”screen” />;
<?php } else { ?>
<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>”
type=”text/css” media=”screen” />
<?php } ?>

<?php next_posts_link(‘Next Entries &raquo;’) ?>
<?php previous_post_link(‘&laquo; Older Entries’); ?>

<ul>
<li<?php if(is_home()) { ?> class=”current_page_item”<?php } ?>><a href=”
<?php bloginfo(‘home’); ?>”>home</a></li>
<?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’); ?>
</ul>

<?php
if (is_home()) { echo bloginfo(‘name’); } elseif (is_404()) { echo ‘Jasleen » 404′; } elseif
(is_search()) { echo ‘Jasleen » Search Results’; } else { echo ‘Jasleen » ‘; wp_title(”); }
?>

<?php query_posts(‘cat=2&showposts=5′); ?>

Loop

<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
// this is the inside of the loop
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>

Unique UI/Template for Cats

<?php
$post = $wp_query- >post;
if ( in_category(’3′) ) {
include(TEMPLATEPATH . ‘/cat3.php’);
} elseif ( in_category(’4′) ) {
include(TEMPLATEPATH . ‘/cat4.php’);
} else {
include(TEMPLATEPATH . ‘/cat.php’);
} ? >

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s