diff --git a/classes/class-admin.php b/classes/class-admin.php index e40f6f38..3de1df36 100644 --- a/classes/class-admin.php +++ b/classes/class-admin.php @@ -2304,8 +2304,31 @@ public function register_controls() { 'category' => 'items-style-' . $category_name . '-elements', 'alongside' => esc_html__( 'Display Title', 'visual-portfolio' ), 'name' => 'show_title', + 'group' => 'items_style_title', 'default' => true, ); + $new_fields[] = array( + 'type' => 'select', + 'category' => 'items-style-' . $category_name . '-elements', + 'label' => esc_html__( 'Title Tag', 'visual-portfolio' ), + 'name' => 'title_tag', + 'group' => 'items_style_title', + 'default' => 'h2', + 'options' => array( + 'div' => '
', + 'h1' => '

', + 'h2' => '

', + 'h3' => '

', + 'h4' => '

', + 'h5' => '

', + 'h6' => '
', + ), + 'condition' => array( + array( + 'control' => 'show_title', + ), + ), + ); } if ( isset( $elements['categories'] ) && $elements['categories'] ) { diff --git a/templates/items-list/item-parts/title.php b/templates/items-list/item-parts/title.php index 97be01cb..a0cf6c9d 100644 --- a/templates/items-list/item-parts/title.php +++ b/templates/items-list/item-parts/title.php @@ -19,6 +19,7 @@ return; } +$title_tag = $opts['title_tag'] ?? 'h2'; $allow_links = isset( $allow_links ) ? $allow_links : false; $link_data = array( 'href' => $allow_links ? $args['url'] : false, @@ -28,10 +29,10 @@ ?> -

+< class="vp-portfolio__item-meta-title"> include_template( 'global/link-start', $link_data ); echo wp_kses_post( $args['title'] ); visual_portfolio()->include_template( 'global/link-end', $link_data ); ?> -

+>