Title: KIA Subtitle
Author: HelgaTheViking
Published: <strong>12 Korrik, 2012</strong>
Last modified: 24 Prill, 2024

---

Kërkoni te shtojca

![](https://ps.w.org/kia-subtitle/assets/banner-772x250.png?rev=3076648)

Kjo shtojcë **s’është testuar me 3 hedhjet e rëndësishme të fundit në qarkullim 
të WordPress-it**. Mund të mos e mirëmbajnë më, ose mundet të mos mbulohet më dhe
mund të ketë probleme përputhshmërie, kur përdoret me versione më të freskët të 
WordPress-it.

![](https://s.w.org/plugins/geopattern-icon/kia-subtitle_f6f5f6.svg)

# KIA Subtitle

 Nga [HelgaTheViking](https://profiles.wordpress.org/helgatheviking/)

[Shkarkim](https://downloads.wordpress.org/plugin/kia-subtitle.4.0.1.zip)

 * [Hollësi](https://sq.wordpress.org/plugins/kia-subtitle/#description)
 * [Shqyrtime](https://sq.wordpress.org/plugins/kia-subtitle/#reviews)
 *  [Instalim](https://sq.wordpress.org/plugins/kia-subtitle/#installation)
 * [Zhvillim](https://sq.wordpress.org/plugins/kia-subtitle/#developers)

 [Asistencë](https://wordpress.org/support/plugin/kia-subtitle/)

## Përshkrim

KIA subtitle allows you to add a subtitle to your posts and retrieve it in the loop
in the same manner as the post title. By using the Subtitle block or the `the_subtitle()`
or `get_the_subtitle() template tags`.

It adds an input field right under the title field of posts, pages and any custom
post type. It also add a subtitle column to the edit screen as well as to the quick
edit.

You can also use the Subtitle block or the shortcode `[the-subtitle]` to display
it within the post content.

### Site Editor

The plugin provides a Subtitle block in the editor. In the post editor, this doesn’t
make a lot of sense, but mimics the core Title block. The ideal use case for the
Subtitle block is when editing your theme

 1. Click Edit Site in the WordPress toolbar
 2. Select the template you wish to edit, commonly this might be called Single Post,
    or Singular.
 3. Insert the Subtitle block where needed, commonly right after the Title block.

### Template Tags

This plugin does _not_ attempt to output the subtitle. With an infinite number of
themes, it is not possible for us to support that. The onus is on the user to customize
their theme accordingly. The plugin provides two template tags that can be used 
to customize your theme as desired.

#### `the_subtitle( string $before

”, string $after = ”, bool $display = true ): void|string` =

Displays or retrieves the current post subtitle with optional markup.

_Parameters_

    ```
    $before `string` `optional`
    Markup to prepend to the title.
    Default: `''`

    $after `string` `optional`
    Markup to append to the title.
    Default: `''`

    $display `bool` `optional`
    Whether to echo or return the title. Default true for echo.
    Default: `true`
    ```

Example usage:

    ```
    if ( function_exists( 'the_subtitle' ) ) the_subtitle( '<h2 class="subtitle">', '</h2>' );
    ```

#### `get_the_subtitle( int|WP_Post $post ): string`

Retrieves the post subtitle.

_Parameters_

    ```
    $post `int|WP_Post` `optional`
    Post ID or WP_Post object.
    Default: global `$post` object.
    ```

`

#### WooCommerce support

There is a small [bridge plugin](https://github.com/helgatheviking/kia-subtitle-woocommerce-bridge)
you can install and activate to automatically display the subtitle in most WooCommerce
locations. This will work for all themes that are using WooCommerce’s default hooks.

_NB:_ It’s known that the Ocean WP theme has it’s own hooks in the WooCommerce templates.
You will need to alter the bridge plugin… please take a look at this [support thread](https://wordpress.org/support/topic/compatibility-with-latest-wp-and-wc/#post-15456180).

#### WPML Ready

KIA Subtitle has been tested by WPML and will allow you to translate the subtitle
on multilingual sites.

#### Ndihma

Support is handled in the [WordPress forums](https://wordpress.org/support/plugin/kia-subtitle).
Please note that support is limited and does not cover any custom implementation
of the plugin.

Please report any bugs, errors, warnings, code problems to [Github](https://github.com/helgatheviking/KIA-Subtitle/issues)

## Foto ekrani

 * [[
 * This is what the input will look like in the Block Editor.
 * [[
 * Insert a subtitle block into your block theme’s template, such as the Singular
   template for displaying Posts.
 * [[
 * This is what the input will look like in the Classic Editor.

## Instalim

 1. Upload the `plugin` folder to the `/wp-content/plugins/` directory
 2. Aktivizojeni shtojcën përmes menusë ‘Shtojca’, te WordPress-i
 3. _For Block Themes:_ Add the subtitle block to your template in the Site Editor
 4. _For Classic Themes:_ Add the ‘the_subtitle()’ tag to your theme

## PBR

### How do I display the subtitle in my theme?

The intended way is with the `the_subtitle()` template tag as follows:

    ```
    if ( function_exists( 'the_subtitle' ) ) the_subtitle();
    ```

You can wrap the string in some markup using the _$before_ and _$after_ parameters.

    ```
    if ( function_exists( 'the_subtitle' ) ) the_subtitle( '<h2 class="subtitle">', '</h2>' );
    ```

As an absolute worst case fallback you could also add the following snippet to your
functions.php in order to prepend the subtitle to the content.

    ```
    /**
     * Prepend the subtitle to the post content. 
     *
     * @param string $content The post content
     * @return string
     */
    function kia_prepend_subtitle_to_content( $content ) {
        if ( ! is_admin() ) {

            $subtitle = function_exists( 'get_the_subtitle' ) ? get_the_subtitle() : '';

            if ( ! empty( $subtitle ) ) {
                $content = '<h2 class="subtitle">' . wp_kses_post( $subtitle ) . '</h2>' . $content;
            }
        }
        return $content;
    }
    add_filter( 'the_content', 'kia_prepend_subtitle_to_content' );
    ```

You could also filter `the_title` and but it would have to be part of the post title’s
markup and could not have it’s own markup as nesting header elements is invalid 
HTML markup.

    ```
    /**
     * Append the subtitle to the title. 
     *
     * @param string $title The post title
     * @return string
     */
    function kia_append_subtitle_to_title( $title ) {
        if ( ! is_admin() ) {
            $subtitle = function_exists( 'get_the_subtitle' ) ? get_the_subtitle() : '';

            if ( ! empty( $subtitle ) ) {
                $title .= ' &mdash; ' . wp_kses_post( $subtitle );
            }
        }
        return $title;
    }
    add_filter( 'the_title', 'kia_append_subtitle_to_title' );
    ```

### Where do I add this code?

Unfortunately, I cannot tell you _exactly_ what file to place the above code in 
because 1. I don’t know where you want to display the subtitle and 2. every theme’s
structure is different.

However, in general, `the_subtitle()` is a template tag so you will want to put 
it in a template file. Probably, you are looking for the file that contains your
post loop. For most themes it’s _single.php_ ( or _page.php_ for pages ), but for
many it could also be _content.php_. Assuming you want the subtitle to display directly
after your main title, you’d place the above code after:

    ```
    <h1 class="entry-title"><?php the_title(); ?></h1>
    ```

As an _example_ if you wanted to display the subtitle on standard single posts, 
in the Twenty Twenty theme you’d create a copy of the entry-header.php template 
in your child theme and modify it as shown in this [gist](https://gist.github.com/helgatheviking/6754a8a381ace9aef325ca3f7b4128c1)

### How do I style the subtitle?

If you have wrapped the subtitle in an H2 tag with the class of subtitle like in
the gist above, you can then style it any way you’d like.

    ```
    .subtitle { color: pink; }
    ```

### Can I display the subtitle for my WooCommmerce products

Yes! You can use this [bridge plugin](https://github.com/helgatheviking/kia-subtitle-woocommerce-bridge)
to automatically display the subtitle in most WooCommerce locations.

### Can I add the subtitle to the Page Title Meta tag

function kia_add_subtitle_to_wp_title( $title ) {
 if ( is_single() && function_exists(‘
get_the_subtitle’ ) ) && $subtitle == get_the_subtitle( get_the_ID() ) ) { $title.
= $subtitle; } } add_filter( ‘wp_title’, ‘kia_add_subtitle_to_wp_title’ );

### Is this translation ready?

WPML now supports KIA Subtitle!

## Shqyrtime

![](https://secure.gravatar.com/avatar/20e9eeac67dd62a2714b101723ef29bcde067fc7911bd04b03de9755ba6a89c6?
s=60&d=retro&r=g)

### 󠀁[Fantastic Plugin and Great Support](https://wordpress.org/support/topic/fantastic-plugin-and-great-support-34/)󠁿

 [MisterH](https://profiles.wordpress.org/hmarksthespot/) 5 Prill, 2024

We have been using this plugin for a while now, and it always works out of the box,
there are some small modifications and css lines we added for it to do what we need.
Its a really good plugin and the support from Helga is awesome! Hope to see this
going for the decades to come!

![](https://secure.gravatar.com/avatar/16893cca2415a99dec03688a075acfc3a15ce99ac6e12938555a58923021e552?
s=60&d=retro&r=g)

### 󠀁[Awesome and Fast Plugin](https://wordpress.org/support/topic/awesome-and-fast-plugin-4/)󠁿

 [Sayf Anwar](https://profiles.wordpress.org/ngorbit/) 30 Mars, 2024 1 përgjigje

easy to use

![](https://secure.gravatar.com/avatar/6f53acd55c3a3f6c15c91df6c8b0a206e7d1a9e75a371c9d4b4fa0b5d8ae4603?
s=60&d=retro&r=g)

### 󠀁[Light,Easy,Github,Support,all a Perfect plugin should be!](https://wordpress.org/support/topic/lighteasygithubsupportall-a-perfect-plugin-should-be/)󠁿

 [saeedhzm](https://profiles.wordpress.org/saeedhzm/) 7 Gusht, 2023 1 përgjigje

<!– wp:paragraph –> <p class=””>Hi</p> <!– /wp:paragraph –> <!– wp:paragraph –> 
<p class=””>may i ask to update this plugin since is not working with latest wordpress
anymore?</p> <!– /wp:paragraph –>

![](https://secure.gravatar.com/avatar/2dbae9845d827a18a872f8d5a630fe082735f929647e9a627f269d5c039e81ed?
s=60&d=retro&r=g)

### 󠀁[Very useful plugin!](https://wordpress.org/support/topic/very-useful-plugin-1242/)󠁿

 [inglar140](https://profiles.wordpress.org/inglar140/) 7 Nëntor, 2021

Very useful plugin! Lightweight, easy to set up, I recommend this plugin! Thank 
you very much!

![](https://secure.gravatar.com/avatar/f57b6ca81b2bff4d536c91bf82201071c5651698c6ed13ee4ad13e4c34d2d84f?
s=60&d=retro&r=g)

### 󠀁[A great plugin](https://wordpress.org/support/topic/a-great-plugin-297/)󠁿

 [jaialai2002](https://profiles.wordpress.org/jaialai2002/) 25 Shkurt, 2021

It is a simple and very useful plugin that I have already used on more than one 
occasion. It works perfectly with several different themes. Currently used with 
Woocommerce on Avada theme and WordPress 5.6.2 Thank you very much

![](https://secure.gravatar.com/avatar/8379383b15aa174bc1ecec13be9166260614cefc1d813a1856c6f89ff2961ee4?
s=60&d=retro&r=g)

### 󠀁[Perfect with GitHub added code for WooCommerce](https://wordpress.org/support/topic/perfect-with-github-added-code-for-woocommerce/)󠁿

 [Ronald van Arkel](https://profiles.wordpress.org/ronald-van-arkel/) 19 Prill, 
2020 2 përgjigje

Thank you so much for this clean and perfect working plugin! Works great with WooCommerce
and StoreFront theme, blends right in, no code modding or CSS needed. Please keep
up the great work and thank you again.

 [ Lexojini krejt 18 shqyrtimet ](https://wordpress.org/support/plugin/kia-subtitle/reviews/)

## Kontribues & Zhvillues

“KIA Subtitle” është software me burim të hapur. Në këtë shtojcë kanë dhënë ndihmesë
personat vijues.

Kontribues

 *   [ HelgaTheViking ](https://profiles.wordpress.org/helgatheviking/)

“KIA Subtitle” është përkthyer në 5 gjuhë. Faleminderit [përkthyesve](https://translate.wordpress.org/projects/wp-plugins/kia-subtitle/contributors)
për ndihmesën e tyre.

[Përkthejeni “KIA Subtitle” në gjuhën tuaj.](https://translate.wordpress.org/projects/wp-plugins/kia-subtitle)

### Ju intereson zhvillimi?

[Shfletoni kodin](https://plugins.trac.wordpress.org/browser/kia-subtitle/), shkarkoni
[depon SVN](https://plugins.svn.wordpress.org/kia-subtitle/), ose pajtohuni përmes
[RSS-je](https://plugins.trac.wordpress.org/log/kia-subtitle/?limit=100&mode=stop_on_copy&format=rss)
te [regjistri i zhvillimeve](https://plugins.trac.wordpress.org/log/kia-subtitle/).

## Regjistër ndryshimesh

#### 4.0.1

 * Fix: Fix script errors when using site editor, by preventing the sidebar panel
   from rendering if NOT editing a post.

#### 4.0.0

 * Important: Requires WordPress 6.1
 * New: Subtitle block
 * New: Introduce `kia_subtitle_sanitize_subtitle` for adding your own custom sanitization
   rules.

#### 3.0.3

 * Fix: Check subtitle is set before updating.

#### 3.0.2

 * Fix: Do not load Gutenberg assets if CPT does not support ‘custom-fields’. Replace
   with fallback metabox.

#### 3.0.1

 * Fix: Remove the duplicate metabox for post types using Classic Editor.

#### 3.0.0

 * Add subtitle as a panel in the Gutenberg editor

#### 2.0.0

 * Add subtitle as a metabox that is compatible with Gutenberg editor

#### 1.6.8

 * Add width to column for WooCommerce products

#### 1.6.7

 * Update donation link
 * Update required and tested against versions
 * Fix column location for WooCommerce products
 * Minify admin script

#### 1.6.6

 * Insert subtitle after title, or at end if subtitle does not exist

#### 1.6.5

 * Add wpml-config.xml for compatibility with WPML

#### 1.6.4

 * Add link to plugin settings
 * testing against WP4.4

#### 1.6.3

 * fix docblock

#### 1.6.2

 * save subtitles on attachments. Apparently attachments don’t fire save_post hook

#### 1.6.1

 * resolve PHP warnings in strict-standards mode

#### 1.6

 * switch to KIA_Subtitle() instance versus global variable

#### 1.5.4

 * restored accidentally deleted script for quick edit

#### 1.5.4

 * remove unneeded script code now that input is using ‘placeholder’
 * remove tabindex on input (wasn’t doing anything anyway)
 * add script to tab from title to subtitle, to content. props @Giuseppe Mazzapica
 * add readme.md

#### 1.5.3

 * verify WP3.8 compatibility
 * remove backcompat on edit_form_after_title hook
 * better docbloc

#### 1.5.2

 * Move changelog back to readme.txt #facepalm

#### 1.5.1

 * Switch sanitization to less restrictive sanitize_post_field, which matches how
   the main post title is sanitized by WordPress
 * Move changelog to separate file

#### 1.5

 * Switch options to “check to enable” instead of “check to disable” (all post types
   are enabled by default)
 * Include upgrade routine to switch any old options to new format
 * Update FAQ with example for Twenty Twelve

#### 1.4.3

 * Adjust $args for get_post_types()
 * Fix buggy conditional logic for users with no post types excluded

#### 1.4.2

 * Adjust $args for get_post_types()
 * switch ‘kia_subtitle_post_types’ filter to ‘kia_subtitle_post_type_args’

#### 1.4.1

 * Adjust $args for get_post_types()
 * add ‘kia_subtitle_post_types’ filter to plugin’s options

#### 1.4

 * Add ability to exclude subtitle from certain post types

#### 1.3.4

 * Add filter `the_subtitle` to allow subtitle content to be modified

#### 1.3.3

 * Fix Notice: Undefined property
 * Clean up enqueue scripts

#### 1.3.2

 * Fix for back-compatibility

#### 1.3.1

 * Add example code to FAQ

#### 1.3

 * Better escaping of HTML attributes thanks to @nealpoole
 * Take advantage of new action hook in WP 3.5

#### 1.2

 * Mimic the_title(), so the_subtitle() now accepts before, after and echo parameters:
   
   the_subtitle( $before = ”, $after = ”, $echo = true )

#### 1.1.2

 * Fixed quick edit refresh ( second click on quick edit for same item and the value
   still reflected the original )

#### 1.1.1

 * Fix ability to remove subtitle

#### 1.1

 * Add column to edit.php screen
 * Add subtitle to quick edit
 * Load script on edit.php screen again

#### 1.0.2

 * update donate link

#### 1.0.1

 * Don’t load script on edit.php screen

#### 1.0

 * Hedhja fillestare në qarkullim.

## Të tjera

 *  Version **4.0.1**
 *  Përditësuar së fundi më **2 vjet më parë**
 *  Instalime aktive **7 000+**
 *  Version WordPress-i ** 6.1 ose më i madh **
 *  E provuar deri me **6.5.0**
 *  Gjuhë
 * [Albanian](https://sq.wordpress.org/plugins/kia-subtitle/), [English (US)](https://wordpress.org/plugins/kia-subtitle/),
   [Italian](https://it.wordpress.org/plugins/kia-subtitle/), [Russian](https://ru.wordpress.org/plugins/kia-subtitle/),
   [Spanish (Spain)](https://es.wordpress.org/plugins/kia-subtitle/) dhe [Swedish](https://sv.wordpress.org/plugins/kia-subtitle/).
 *  [Përkthejeni në gjuhën tuaj](https://translate.wordpress.org/projects/wp-plugins/kia-subtitle)
 * Etiketa
 * [simple](https://sq.wordpress.org/plugins/tags/simple/)[subtitle](https://sq.wordpress.org/plugins/tags/subtitle/)
 *  [Pamje e Thelluar](https://sq.wordpress.org/plugins/kia-subtitle/advanced/)

## Vlerësime

 5 nga 5 yje të mundshëm.

 *  [  18 shqyrtime me 5 yje     ](https://wordpress.org/support/plugin/kia-subtitle/reviews/?filter=5)
 *  [  0 shqyrtime me 4 yje     ](https://wordpress.org/support/plugin/kia-subtitle/reviews/?filter=4)
 *  [  0 shqyrtime me 3 yje     ](https://wordpress.org/support/plugin/kia-subtitle/reviews/?filter=3)
 *  [  0 shqyrtime me 2 yje     ](https://wordpress.org/support/plugin/kia-subtitle/reviews/?filter=2)
 *  [  0 shqyrtime me 1 yje     ](https://wordpress.org/support/plugin/kia-subtitle/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/kia-subtitle/reviews/#new-post)

[Shihni krejt shqyrtimet](https://wordpress.org/support/plugin/kia-subtitle/reviews/)

## Kontribues

 *   [ HelgaTheViking ](https://profiles.wordpress.org/helgatheviking/)

## Asistencë

Keni diçka për të thënë? Ju duhet ndihmë?

 [Shihni forum asistence](https://wordpress.org/support/plugin/kia-subtitle/)

## Dhuroni

Do të donit të përkrahnit shpënien më tej të kësaj shtojce?

 [ Dhuroni për këtë shtojcë ](https://www.paypal.me/kathyisawesome)