Title: WP Extra Template Tags
Author: Jenst
Published: <strong>28 agosto, 2008</strong>
Last modified: 21 setembro, 2008

---

Pesquisar plugins

Este plugin **não foi testado com os 3 lançamentos principais mais recentes do WordPress**.
Ele pode não ser mais mantido ou suportado e pode ter problemas de compatibilidade
quando usado com versões mais recentes do WordPress.

![](https://s.w.org/plugins/geopattern-icon/wp-extra-template-tags.svg)

# WP Extra Template Tags

 Por [Jenst](https://profiles.wordpress.org/jenst/)

[Baixar](https://downloads.wordpress.org/plugin/wp-extra-template-tags.0.4.zip)

 * [Detalhes](https://br.wordpress.org/plugins/wp-extra-template-tags/#description)
 * [Avaliações](https://br.wordpress.org/plugins/wp-extra-template-tags/#reviews)
 *  [Instalação](https://br.wordpress.org/plugins/wp-extra-template-tags/#installation)
 * [Desenvolvimento](https://br.wordpress.org/plugins/wp-extra-template-tags/#developers)

 [Suporte](https://wordpress.org/support/plugin/wp-extra-template-tags/)

## Descrição

#### WordPress template tags

To make it easy to edit themes and plugins there are many build in [template tags](https://codex.wordpress.org/Template_Tags)
within the WordPress code. I did not found all the tags I wanted so I created them
and now provides as a plugin.

For usage go to “[Installation](https://wordpress.org/extend/plugins/wp-extra-template-tags/installation/)“

#### Updates

    ```
    0.4 - _get_category_count() and _category_count() functions updated
    0.3 - _get_depth(), _is_child(), is_grandchild() functions created
    0.2 - _get_the_content_with_formatting() function created
    0.1 - Plugin created
    ```

#### Prevents collisions

Every extra template tag with this plugin has an underscore before the function 
name. That is to prevent collisions if the WordPress team develop the functions 
in the future.

#### Add an extra template tag

If you have an own extra template tag, send it to me and if it is a good one I will
include it in the next plugin update. For bug reports, donations, feedback, more
plugins and themes visit [web-templates.nu](http://www.web-templates.nu/2008/08/25/wp-extra-template-tags/)

## Instalação

 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'); ?>
    ```

## Perguntas frequentes

  How do I report a bug?

Contact me [here](http://www.web-templates.nu/2008/08/25/wp-extra-template-tags/).
Describe the problem as good as you can, your plugin version, WordPress version 
and possible conflicting plugins and so on.

  How can I support this plugin?

The best way to contribute is to spread the word, link to [WP Extra Template Tags](http://www.web-templates.nu/2008/08/25/wp-extra-template-tags/),
blog about WP Extra Template tags or give me feedback. All kinds of feedback are
helpful to me. Suggestions and bug report are also welcome.

  Where can I use the extra template tags?

You could use them in your theme. If you want you can use them within plugins as
well.

## Avaliações

Não há avaliações para este plugin.

## Colaboradores e desenvolvedores

“WP Extra Template Tags” é um programa de código aberto. As seguintes pessoas contribuíram
para este plugin.

Colaboradores

 *   [ Jenst ](https://profiles.wordpress.org/jenst/)

[Traduzir o “WP Extra Template Tags” para seu idioma.](https://translate.wordpress.org/projects/wp-plugins/wp-extra-template-tags)

### Interessado no desenvolvimento?

[Navegue pelo código](https://plugins.trac.wordpress.org/browser/wp-extra-template-tags/),
consulte o [repositório SVN](https://plugins.svn.wordpress.org/wp-extra-template-tags/)
ou assine o [registro de desenvolvimento](https://plugins.trac.wordpress.org/log/wp-extra-template-tags/)
por [RSS](https://plugins.trac.wordpress.org/log/wp-extra-template-tags/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Versão **0.4**
 *  Última atualização **18 anos atrás**
 *  Instalações ativas **60+**
 *  Versão do WordPress ** 2.5 ou superior **
 *  Testado até **2.6**
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/wp-extra-template-tags/)
 * Tags
 * [page](https://br.wordpress.org/plugins/tags/page/)[permalink](https://br.wordpress.org/plugins/tags/permalink/)
   [post](https://br.wordpress.org/plugins/tags/post/)[tags](https://br.wordpress.org/plugins/tags/tags/)
   [template](https://br.wordpress.org/plugins/tags/template/)
 *  [Visualização avançada](https://br.wordpress.org/plugins/wp-extra-template-tags/advanced/)

## Classificações

Ainda não foi enviada nenhuma avaliação.

[Your review](https://wordpress.org/support/plugin/wp-extra-template-tags/reviews/#new-post)

[Ver todas avaliações](https://wordpress.org/support/plugin/wp-extra-template-tags/reviews/)

## Colaboradores

 *   [ Jenst ](https://profiles.wordpress.org/jenst/)

## Suporte

Tem algo a dizer? Precisa de ajuda?

 [Ver fórum de suporte](https://wordpress.org/support/plugin/wp-extra-template-tags/)