Top Word Press template tags

Socrates Premium Wordpress Theme

Socrates Premium Wordpress Theme

Get Instant Access

The following are the top WordPress template tags that I find most useful for helping out with jQuery and theme development:

Template Tag

Description

Parameters bloginfo()

Sample:

bloginfo('name'

Displays your blog's information supplied by your user profile and general options in the Administration Panel.

More Info:

http://codex. wordpress.org/ Template_Tags/ bloginfo.

Any text characters you want to appear before and after the tags, as well as to separate them—name, description, url, rdf_url, rss_url, rss2_url, atom_url, comments_rss2_url, pingback_url, admin_email, charset, version.

Default: No parameters will display anything. You must use a parameter.

wp_title()

Sample:

Displays the title of a page or Any text characters you want single post.

Note: Use this tag anywhere outside The Loop.

More Info:

http://codex. wordpress.org/ Template_Tags/wp_ title.

You can set up a Boolean to display the title —

As of version 2.5+: You can decide if the separator goes before or after the title— ("--", true, "right").

Default: No parameters will display the page title with a separator if a separator is assigned its default to the left.

Template Tag

Description

Parameters the_title()

Sample:

the_content()

Sample:

the_content(

'more_link_text' strip_teaser, 'more file'

the_category()

Sample:

the_category('

Displays the title of the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/the_ title.

Displays the content and markup you've edited into the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/the_ content.

Any text characters you want to appear before and after the title— ("<h2>", "</h2>") .

You can also set a Boolean to turn the display to false— ("<h2>", "</h2>", "false") .

Default: No parameters will display the title without a markup.

As you can add text to display the "more link", a Boolean to show or hide the "teaser text", there is a third parameter for more_file that currently doesn't work— ("Continue reading" . the_ title()).

You can also set a Boolean to turn the display to false— ("<h2>", "</h2>", "false") .

Default: No parameters will display the content for the post with a generic "read more" link.

Displays a link to the categoryYou can include text or categories a post is assigned to.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop)

More Info:

http://codex. wordpress.org/ Template_Tags/the_ category .

separators in case there's more than one category — ('&gt;').

Default: No parameters will display a comma separation if there is more than one category assigned.

Template Tag the_author_meta()

Sample:

the_author_meta();

wp_list_pages()

Sample:

Sample:

Description

Displays the author of a post or a page.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/the_ author meta.

Displays a list of menu items assigned to a WordPress 3.0+ menu, as links.

More Info:

http://codex. wordpress.org/ Function_Reference/wp_ nav_menu.

Parameters

This tag accepts a large amount of parameters. They are covered in the previous sections you can also check out the codex.

sort_column.

Default: No parameters will display each title link in an <li> list and include an <ul> tag around the list (not recommended if you want to add your own custom items to the page navigation).

This tag accepts a large amount of parameters, the most common parameter is the name of the menu set up in the menu tool in the Administration Panel.

If no menu is available, the function will default to the wp_list_pages(); tag.

Please see the codex for more parameters.

Displays a list of WordPress pages as links.

More Info:

http://codex. wordpress.org/ Template_Tags/wp_list pages.

title_li is the most useful as it wraps the page name and link in list tags <li>.

The other parameters can be set by separating with an "&": depth, show_date, date_format, child_of, exclude, echo, authors,

Template Tag

Description

Parameters next_post_link()

Sample:

next_post_link( '<strong>

previous_post_link()

Sample:

previous_post_link( '<strong>

Displays a link to the next post which exists in chronological order from the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: UnderstandingjQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/next_ post_link.

Displays a link to the previous post which exists in chronological order from the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/ previous_post_link.

Any markup and text characters you want to appear —

%link will display the permalink, %title the title of the next post.

Default: No parameters will display the next post title as a link followed by angular quotes (>>).

Any markup and text characters you want to appear —

%link will display the permalink, %title the title of the next post.

Default: No parameters will display the previous post title as a link preceded by angular quotes (<<).

Template Tag

Description

Parameters comments_number()

Sample:

comments_number( 'no responses', 'one response', '% responses');

Displays the total number of comments, Trackbacks, and Pingbacks for a post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/ comments number.

comments_popup_link()

Sample:

comments_popup_link( 'Add Your Thoughts'

If the comments_popup_ script is not used, this displays a normal link to comments.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/ comments_popup_link.

Lets you specify how to display if there are 0 comments, only 1 comment, or many comments— ('no responses','one response','% responses').

You can also wrap items in additional markup— ("No Comments","<span class="bigNum">1</ span> response","<span class="bigNum">%</ span> Comments") .

Default: No parameters will display:

No comments, or 1 comment, or ? comments.

Lets you specify how to display if there are 0 comments, only 1 comment, or many comments— ("No comments yet", "1 comment so far",

"% comments so far (is that a lot?)", "comments-link", "Comments are off for this post").

Default: No parameters will display the same default information as the comments_number() tag.

Template Tag

Description

Parameters edit_post_link()

Sample:

the_permalink()

Sample:

the_permalink();

Sample:

Any text that you want to be in the name of the link, plus markup that you'd like to come before and after it—("edit me!", "<strong>", "</ strong>") .

Default: No parameters will display a link that says "edit" with no additional markup.

If the user is logged in and has permission to edit the post, this displays a link to edit the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: UnderstandingjQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/edit_ post_link.

Displays the URL for the This tag has no parameters. permalink to the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

http://codex. wordpress.org/ Template_Tags/the_ permalink.

Displays the numeric ID of the current post.

Note: Use this tag in The Loop. (See Chapter 3, Digging Deeper: Understanding jQuery and WordPress Together for how to set up The Loop.)

More Info:

wordpress.org/

Template_Tags/the_ID.

This tag has no parameters.

Template Tag wp_get_archives()

Sample:

wp_get_archives( 'type=monthly');

Description

Displays a date-based archives list.

More Info:

http://codex. wordpress.org/ Template_Tags/wp_get archives.

Parameters

You can set parameters by separating them with an "&"— ('type=monthly&lim it=12').

The other parameters are type, limit, format, before, after, show_ post_count.

Default: No parameters will display a list of all your monthly archives in HTML format without before or after markup and show_post_ count set to false.

get_calendar()

Sample:

get_calendar(false);

Displays the current month/ year calendar.

More Info:

http://codex. wordpress.org/ Template_Tags/get_ calendar.

A Boolean value can be set which will display a singleletter initial (S = Sunday) if set to true. Otherwise, it will display the abbreviation based on your localization (Sun = Sunday)-(true)

Default: No parameters will display the single-letter abbreviation.

Was this article helpful?

0 0
7 Days to Profitable Blogging

7 Days to Profitable Blogging

Learn The Simple Blueprint To Successfully Starting a Profitable Blog In Just 7 Days? MOST blogs fail because their owners start out badly, and continue to make mistakes. By the time they realize what's gone wrong, they would be quicker restarting!

Get My Free Ebook


Post a comment