banner Direct To India is India based software services company. DTI is comprised of Management, Website Designers, and Software Engineers from India bringing their own unique talents and perspectives to better serve our clients. DTI's approach is dynamic. Our results are stunning and global in their reach. Direct To India is specializing in cutting edge internet solutions, software development, database development and development of Web Applications using a variety of technologies. More...
Aug
26th

WordPress Global Variable List and their usage

Author: kpatelseo | Files under Web Development

Wordpress variables and functions were always confuse me, But I research and make a list of wordpress global variables & function list to save valuable time for bloggers like me, who need to optimize their post dynamically. You can check metatags of any of post on this blog to get better idea what I am dynamically getting in my metatags.

Variable List and their usage by passing them in bloginfo():
“<?php bloginfo(’name’); ?> : Returns Title of the Blog”
“<?php wp_title(); ?> : Returns Title of the specific post”
“<?php bloginfo(’stylesheet_url’); ?> : Returns the location path of CSS file”
“<?php bloginfo(’pingback_url’); ?> : Returns the Pingback URL of the Blog”
“<?php bloginfo(’template_url’); ?> : Returns the URL of Blog Theme”
“<?php bloginfo(’version’); ?> : Returns the Version of Wordpress Blog”
“<?php bloginfo(’atom_url’); ?> : Returns Atom URL of the Blog”
“<?php bloginfo(’rss2_url’); ?> : Returns RSS URL of the Blog”
“<?php bloginfo(’url’); ?> : Returns exact url of the blog”
“<?php bloginfo(’name’); ?> : Returns the name of the blog”
“<?php bloginfo(’html_type’); ?> : Returns HTML version of the blog”
“<?php bloginfo(’charset’); ?> : Returns character set parameter of the blog”

Template Level Variables/Function

“<?php the_content(); ?> : Returns  Content of the posts”
“<?php if(have_posts()) : ?> : Checks if there are posts”
“<?php while(have_posts()) : the_post(); ?> : Shows posts if posts are available”
“<?php endwhile; ?> : Closes the ‘while’ PHP function”
“<?php endif; ?> : Closes the ‘if’ PHP function”
“<?php get_header(); ?> : Returns Header.php’s content”
“<?php get_sidebar(); ?> : Returns Sidebar.php’s content”
“<?php get_footer(); ?> : Returns Footer.php’s content”
“<?php the_time(’m-d-y’) ?> : Returns the date in ‘08-18-07′ format”
“<?php comments_popup_link(); ?> : Returns Link for the comments on the post”
“<?php the_title(); ?> : Returns Title of a specic post or page”
“<?php the_permalink() ?> : Returns Url of a specic post or page”
“<?php the_category(’, ‘) ?> : Returns Category of a specic post or page”
“<?php the_author(); ?> : Returns Author of a specic post or page”
“<?php the_ID(); ?> : Returns ID of a specic post or page”
“<?php edit_post_link(); ?> : Returns Link to edit a specic post or page”
“<?php get_links_list(); ?> : Returns Links from the blogroll”
“<?php comments_template(); ?> : Returns Comment.php’s content”
“<?php wp_list_pages(); ?> : Returns List of pages”
“<?php wp_list_cats(); ?> : Returns List of categories for the blog”
“<?php next_post_link(’ %link ‘) ?> : Returns Url to the next post”
“<?php previous_post_link(’%link’) ?> : Returns Url to the previous post”
“<?php get_calendar(); ?> : Returns The built-in calendar”
“<?php wp_get_archives() ?> : Returns List of archives for the blog”
“<?php posts_nav_link(); ?> : Returns Next and previous post link”
“<?php bloginfo(’description’); ?> : Returns Site’s description”

Basic Template Files used in Word Press
style.css : Style sheet
index.php : Home Page Template
single.php : Single Post Template
archive.php : Archive/category
searchform.php : Search Form
search.php : Search Content
404.php : Error Page
comments.php : Comments Template
footer.php : Footer Template
header.php : Header Content
sidebar.php : Sidebar Content
page.php : Single Page Template (ex. About, Contact etc.)

Hope this post improve your blog optimization, If you are not aware about Search Engine Optimization, Get Free SEO Report for your website from Direct to India.

4 responses. Wanna say something?

  1. SEO Florida
    Aug 26, 2008 at 07:17:07
    #1

    Extremely wonderful information.
    It’s great research by you.

  2. stratosg
    Oct 26, 2008 at 13:50:15
    #2

    thx man! excellent post! bookmarked!

2 Trackback(s)

  1. Oct 10, 2008: vBulletin Setup [dot] Org » Blog Archive » Wordpress Global Variable List
  2. Oct 14, 2008: wordpress themes for free

Post a Comment