WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WP Extra Template Tags

This plugin provides WordPress users with extra template tags. It can be used in themes or plugins.

  1. Upload the FOLDER 'wp-extra-template-tags' to the '/wp-content/plugins/'
  2. Activate the plugin 'WP Extra Template Tags' through the 'Plugins' menu in admin
  3. Call the functions of your choice from your theme or plugin

Category ID

Displays or returns the numeric ID of the category a post belongs to. This tag must be used within The Loop.

<?php _category_ID(); ?>
<?php echo _get_category_ID(); ?>

Category Parent ID

Displays or returns the numeric parent ID of the category a post belongs to. This tag must be used within The Loop.

<?php _category_parent_ID(); ?>
<?php echo _get_category_parent_ID(); ?>

Category Slug

Displays or returns the category slug/nicename of the category a post belongs to. This tag must be used within The Loop.

<?php _category_slug(); ?>
<?php echo _get_category_slug(); ?>

Category Name

Displays or returns the name/title of the category a post belongs to. This tag must be used within The Loop.

<?php _category_name(); ?>
<?php echo _get_category_name(); ?>

Category Count

Displays or returns the number of posts within a category. It can be used with a post ID, post slug (nicename) or empty used within The Loop.

<?php _category_count(); ?>
<?php _category_count(3); ?>
<?php _category_count('about'); ?>
<?php echo _get_category_count(); ?>
<?php echo _get_category_count(3); ?>
<?php echo _get_category_count('about'); ?>

Get Category Name By ID

Returns the name/title of the category ID.

<?php echo _get_category_name_by_ID(3); ?>

Get Category ID By Name

Returns the ID of the category slug/nicename.

<?php echo _get_category_ID_by_name('about'); ?>

User ID

Displays or returns the user ID of the logged in user.

<?php _user_id(); ?>
<?php echo _get_user_id(); ?>

User Name

Displays or returns the user name of the logged in user.

<?php _user_name(); ?>
<?php echo _get_user_name(); ?>

User Level

Displays or returns the user level of the logged in user.

<?php _user_level(); ?>
<?php echo _user_level(); ?>

ID by Page Name

Returns the page ID by page or post slug/nicename.

<?php echo _get_ID_by_page_name('about'); ?>

Name by Page ID

Returns the page slug/nicename by page or post ID.

<?php echo _get_name_by_page_ID(3); ?>

Max Pages

Displays or returns the max amount of pages per post. This tag must be used within The Loop.

<?php _max_pages(); ?>
<?php echo _get_max_pages(); ?>

Depth

Returns the depth of a page. It can be used with a page ID or empty used within The Loop.

<?php echo _get_depth(); ?>
<?php echo _get_depth(3); ?>

Is Child

Returns true if the current page is a child. It can be used with a page ID or empty used within The Loop.

<?php if(_is_child()) { echo 'This is a child page'; } ?>
<?php if(_is_child(3)) { echo 'This is a child page'; } ?>

Is Grandchild

Returns true if the current page is a grandchild.

<?php if(_is_grandchild()) { echo 'This is a grandchild page'; } ?>

Delete Post Link

Displays a link to delete current post or page for logged in administrators. Be careful!

<?php _delete_post_link(); ?>

Get The Content with Formatting

Returns get_the_content() tag WITH formatting like the_content().

<?php echo _get_the_content_with_formatting(); ?>

Parent Permalink

Displays or returns the parent permalink. This tag must be used within The Loop.

<?php _parent_permalink(); ?>
<?php echo _get_parent_permalink(); ?>

Permalink by Name

Displays or returns the permalink by page or post slug/nicename.

<?php _permalink_by_name('about'); ?>
<?php echo _get_permalink_by_name('about'); ?>

Requires: 2.5 or higher
Compatible up to: 2.6
Last Updated: 2008-9-21
Downloads: 2,423

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
100,1,1