Change Deal and Post Carrousel Title from H2 to H4

Open
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme February 03, 2020
Login to reply
Ignacio Santiago
3 weeks ago

Thanks!!! It worked

Igor Sunz Support Agent
3 weeks ago

do this for inc/parts/query_type1.php also

Ignacio Santiago
3 weeks ago

Done!

And I still see the H2 in this page: https://estafados.red/estafometro/

Igor Sunz Support Agent
3 weeks ago

Copy file to the same folder as in main theme

вт, 4 февр. 2020 г., 18:44 Sizam Support Help Desk <
sizamtheme+zK5On1rwJ7LY6kdGVpBR@mail.support-hub.io>:

Ignacio Santiago
3 weeks ago

You are right.

You mean this one?

How I add the change to functions.php? I am adding the whole code changin h2 with h4, but it breaks the site.


<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>

<?php

global $post;

if (isset($aff_link) && $aff_link == '1') {

    $link = rehub_create_affiliate_link ();

    $target = ' rel="nofollow" target="_blank"';

}

else {

    $link = get_the_permalink();

    $target = '';

}

?>

<article class="small_post col_item<?php if(is_sticky()) {echo " sticky";} ?>">

    <div class="top">

        <div class="cats_def">

            <?php

            if(rehub_option('exclude_cat_meta') != 1) {

                if ('post' == get_post_type($post->ID)) {

                    $category = get_the_category();

                    if($category){

                        $first_cat = $category[0]->term_id;

                        $cat_data = get_option("category_$first_cat");

                        $output='';

                        $output .= '<a href="'.get_category_link($first_cat ).'" class="cat-'.$first_cat.'"';

                        if (!empty($cat_data['cat_color'])) {

                          $output .= ' style="color: '.$cat_data["cat_color"].' !important; "';

                        }

                        $output .='>'.$category[0]->cat_name.'</a>';

                        echo ''.$output;

                    }

                }

                elseif ('blog' == get_post_type($post->ID)) {

                    $term_list = get_the_term_list( $post->ID, 'blog_category', '', ' ', '' );

                    if($term_list && !is_wp_error($term_list)){

                        echo ''.$term_list;

                    }

                }

            }

            ?>

         </div>

        <?php if (rehub_option('exclude_comments_meta') == 0) : ?><?php comments_popup_link( 0, 1, '%', 'comment_two', ''); ?><?php endif ;?>

    </div>

    <h2><?php if(is_sticky()) {echo "<i class='far fa-thumb-tack'></i>";} ?><a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php the_title();?></a></h2>

    <div class="post-meta"> <?php meta_all( true, false, true ); ?> </div>

    <?php do_action( 'rehub_after_masonry_grid_meta' ); ?>

    <div class="mb10"><?php rehub_format_score('small') ?></div>

    <?php if(vp_metabox('rehub_post.rehub_framework_post_type') == 'music') : ?>

        <?php if(vp_metabox('rehub_post.music_post.0.music_post_source') == 'music_post_soundcloud') : ?>

            <div class="music_soundcloud mb15">

                <?php echo vp_metabox('rehub_post.music_post.0.music_post_soundcloud_embed'); ?>

            </div>

        <?php elseif(vp_metabox('rehub_post.music_post.0.music_post_source') == 'music_post_spotify') : ?>

            <div class="music_spotify mb15">

                <iframe src="https://embed.spotify.com/?uri=<?php echo vp_metabox('rehub_post.music_post.0.music_post_spotify_embed'); ?>" width="100%" height="80" frameborder="0" allowtransparency="true"></iframe>

            </div>

        <?php endif; ?>

    <?php else : ?>

        <figure class="mb15">

            <?php if(rehub_option('repick_social_disable') !='1' && function_exists('rehub_social_share')) :?> <?php echo rehub_social_share('minimal'); ?> <?php endif;?>

            <?php echo re_badge_create('ribbonleft'); ?>

            <div class="pattern"></div>

            <a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php wpsm_thumb ('grid_news') ?></a>

        </figure>

    <?php endif; ?>

    <?php do_action( 'rehub_after_masonry_grid_figure' ); ?>

    <p><?php kama_excerpt('maxchar=200'); ?></p>

    <?php do_action( 'rehub_after_masonry_grid_text' ); ?>

 <?php if(rehub_option('disable_btn_offer_loop')!='1') : ?><?php rehub_create_btn('yes') ;?><?php endif; ?>

</article>

Igor Sunz Support Agent
3 weeks ago

List is not carousel. you asked about carousel. 

inc/parts/query_type3 is file for list

Ignacio Santiago
3 weeks ago

News / Directory List

Igor Sunz Support Agent
3 weeks ago

which module do you use for carousel?

Ignacio Santiago
3 weeks ago

Added this to functions.php, and I still see the h2


//////////////////////////////////////////////////////////////////

// DEAL and POST CAROUSEL

//////////////////////////////////////////////////////////////////

if( !function_exists('deal_carousel_shortcode') ) {

function deal_carousel_shortcode( $atts, $content = null ) {

$build_args =shortcode_atts(array(

 'data_source' => 'cat', //Filters start

 'cat' => '',

 'tag' => '',

 'cat_exclude' => '',

 'tag_exclude' => '', 

 'ids' => '', 

 'orderby' => '',

 'order' => 'DESC', 

 'meta_key' => '',

 'show' => 8,

 'offset' => '',

 'show_date' => '', 

 'post_type' => '',

 'tax_name' => '',

 'tax_slug' => '',

 'tax_slug_exclude' => '',

 'post_formats' => '',

 'badge_label'=> '1', 

 'enable_pagination' => '',

 'price_range' => '',  

 'show_coupons_only' =>'', //Filters end

 'style' => '1',

 'aff_link' => '',

 'autorotate'=> '',

 'showrow'=> '5',

 'nav_dis' => '',  

), $atts, 'post_carousel_mod');  

extract($build_args);

$columns = $showrow.'_col';

ob_start(); 

?>

<?php wp_enqueue_script('owlcarousel'); ?>

<?php $autodata = ($autorotate) ? 'data-auto="1"' : 'data-auto="0"' ;?>

<?php $disable_nav = ($nav_dis) ? 'data-navdisable="1"' : '' ;?>

<?php $disable_nav_class = ($nav_dis) ? ' no-nav-carousel' : '' ;?>

<?php

 global $wp_query; 

 $argsfilter = new WPSM_Postfilters($build_args);

 $args = $argsfilter->extract_filters();

 $args['ignore_sticky_posts'] = 1;

?>

<?php if ($style == 2):?>  

    <div class="loading carousel-style-fullpost <?php echo ''.$disable_nav_class;?>">

        <div class="re_carousel eq_grid post_eq_grid" data-showrow="<?php echo esc_attr($showrow);?>" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?> data-laizy="0">

         <?php $result_cat = array(); 

             $deal_carousel = new WP_Query($args); 

             if( $deal_carousel->have_posts() ) :

             while($deal_carousel->have_posts()) : $deal_carousel->the_post();

          global $post;

         ?>

    <?php include(rh_locate_template('inc/parts/compact_grid.php')); ?>

            <?php endwhile; endif; wp_reset_query(); ?>

        </div>

    </div> 

<?php elseif ($style == 'simple'):?>  

 <div class="post_carousel_block loading carousel-style-2<?php echo ''.$disable_nav_class;?>">

     <div class="re_carousel" data-showrow="<?php echo esc_attr($showrow);?>" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?> data-laizy="1">

         <?php $result_cat = array();

             $home_carousel = new WP_Query($args); 

             if( $home_carousel->have_posts() ) :

             while($home_carousel->have_posts()) : $home_carousel->the_post();

         ?>

   <?php 

   if ($aff_link == '1') {

       $link = rehub_create_affiliate_link ();

       $target = ' rel="nofollow" target="_blank"';

   }

   else {

       $link = get_the_permalink();

       $target = '';  

   }

   ?> 

         <?php 

         $showimg = new WPSM_image_resizer();

         $showimg->use_thumb = true;

         $showimg->no_thumb = get_template_directory_uri() . '/images/default/noimage_336_220.png';

         $showimg->width = '336';

         $showimg->height = '220';

         $showimg->crop = true;

         $showimg->lazy = false;                                    

         ?>

         <?php  

         if ('post' == get_post_type($home_carousel->ID)) {

             $category = get_the_category();

    $category_id = $category[0]->term_id; 

    $category_echo = $category_id;                   

         }

         else {$category_echo = ''; }

         ?>

         <div class="carousel-item tabcat-<?php echo ''.$category_echo;?>">

             <figure>

                 <a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>>

                  <img class="owl-lazy" data-src="<?php echo ''.$showimg->get_resized_url();?>" alt="<?php the_title_attribute(); ?>">

                 </a>                                           

             </figure> 

       <div class="text-oncarousel">

           <h3><a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php the_title();?></a></h3>

              <div class="post-meta"><?php if ('post' == get_post_type($home_carousel->ID)) {meta_small( false, $category_id, false, false );} ?></div>                          

              <?php rehub_create_btn('', 'price');?>

              <?php do_action( 'rehub_after_uni_carousel_text' ); ?>

          </div>                                          

         </div>

         <?php endwhile; endif; wp_reset_query(); ?>

     </div>

 </div>     

<?php else:?>

    <div class="post_carousel_block loading carousel-style-3 <?php echo ''.$disable_nav_class;?>">

        <div class="re_carousel" data-showrow="3" data-laizy="1" data-fullrow="2" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?>>

         <?php $result_cat = array(); 

             $deal_carousel = new WP_Query($args); 

             if( $deal_carousel->have_posts() ) :

             while($deal_carousel->have_posts()) : $deal_carousel->the_post();

          global $post;

         ?>

   <?php 

   if ($aff_link == '1') {

       $link = rehub_create_affiliate_link ();

       $target = ' rel="nofollow" target="_blank"';

   }

   else {

       $link = get_the_permalink();

       $target = '';  

   }

   ?> 

            <?php 

            $showimg = new WPSM_image_resizer();

            $showimg->use_thumb = true;

            $showimg->height = '120';

            $showimg->crop = true;

            $showimg->lazy = false;

         $showimg->no_thumb = get_template_directory_uri() . '/images/default/noimage_200_140.png';                                                

            ?>

            <?php   

            if ('post' == get_post_type($post->ID)) {

                $category = get_the_category();

                $category_id = $category[0]->term_id; 

                $category_echo = $category_id;                      

            }

            else {$category_echo = ''; }

            ?>

            <div class="carouselhor-item">

                <div class="l-part-car">

                    <figure>

                        <a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>>

                            <img class="owl-lazy" height="120" data-src="<?php echo ''.$showimg->get_resized_url();?>" alt="<?php the_title_attribute(); ?>">

                        </a>                                           

                    </figure> 

                </div>

                <div class="r-part-car">

                    <?php echo getHotIconfire($post->ID);?><?php echo getHotLikeTitle($post->ID);?>

                    <h4><a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php echo wp_trim_words( get_the_title($post->ID), 8, '...' );?></a></h4>

                    <div class="post-meta"><?php if ('post' == get_post_type($post->ID)) {meta_small( false, $category_id, false, false );} ?></div>                                

                    <?php rehub_create_price_for_list($post->ID);?>

                    <?php do_action( 'rehub_after_recash_carousel_text' ); ?>

                </div>                                           

            </div>

            <?php endwhile; endif; wp_reset_query(); ?>

        </div>

    </div> 

<?php endif;?>    


<?php 

$output = ob_get_contents();

ob_end_clean();

return $output;

}

}

Igor Sunz Support Agent
3 weeks ago

yes, correct. place in functions.php of child theme

Ignacio Santiago
3 weeks ago

Ok.

So I just need to copy the whole code:

//////////////////////////////////////////////////////////////////

// DEAL and POST CAROUSEL

//////////////////////////////////////////////////////////////////

if( !function_exists('deal_carousel_shortcode') ) {

function deal_carousel_shortcode( $atts, $content = null ) {

$build_args =shortcode_atts(array(

 'data_source' => 'cat', //Filters start

 'cat' => '',

 'tag' => '',

 'cat_exclude' => '',

 'tag_exclude' => '',

 'ids' => '',

 'orderby' => '',

 'order' => 'DESC',

 'meta_key' => '',

 'show' => 8,

 'offset' => '',

 'show_date' => '',

 'post_type' => '',

 'tax_name' => '',

 'tax_slug' => '',

 'tax_slug_exclude' => '',

 'post_formats' => '',

 'badge_label'=> '1',

 'enable_pagination' => '',

 'price_range' => '',

 'show_coupons_only' =>'', //Filters end

 'style' => '1',

 'aff_link' => '',

 'autorotate'=> '',

 'showrow'=> '5',

 'nav_dis' => '',

), $atts, 'post_carousel_mod');

extract($build_args);

$columns = $showrow.'_col';

ob_start();

?>

<?php wp_enqueue_script('owlcarousel'); ?>

<?php $autodata = ($autorotate) ? 'data-auto="1"' : 'data-auto="0"' ;?>

<?php $disable_nav = ($nav_dis) ? 'data-navdisable="1"' : '' ;?>

<?php $disable_nav_class = ($nav_dis) ? ' no-nav-carousel' : '' ;?>

<?php

 global $wp_query;

 $argsfilter = new WPSM_Postfilters($build_args);

 $args = $argsfilter->extract_filters();

 $args['ignore_sticky_posts'] = 1;

?>

<?php if ($style == 2):?>

    <div class="loading carousel-style-fullpost <?php echo ''.$disable_nav_class;?>">

        <div class="re_carousel eq_grid post_eq_grid" data-showrow="<?php echo esc_attr($showrow);?>" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?> data-laizy="0">

         <?php $result_cat = array();

             $deal_carousel = new WP_Query($args);

             if( $deal_carousel->have_posts() ) :

             while($deal_carousel->have_posts()) : $deal_carousel->the_post();

          global $post;

         ?>

    <?php include(rh_locate_template('inc/parts/compact_grid.php')); ?>

            <?php endwhile; endif; wp_reset_query(); ?>

        </div>

    </div>

<?php elseif ($style == 'simple'):?>

 <div class="post_carousel_block loading carousel-style-2<?php echo ''.$disable_nav_class;?>">

     <div class="re_carousel" data-showrow="<?php echo esc_attr($showrow);?>" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?> data-laizy="1">

         <?php $result_cat = array();

             $home_carousel = new WP_Query($args);

             if( $home_carousel->have_posts() ) :

             while($home_carousel->have_posts()) : $home_carousel->the_post();

         ?>

   <?php

   if ($aff_link == '1') {

       $link = rehub_create_affiliate_link ();

       $target = ' rel="nofollow" target="_blank"';

   }

   else {

       $link = get_the_permalink();

       $target = '';

   }

   ?>

         <?php

         $showimg = new WPSM_image_resizer();

         $showimg->use_thumb = true;

         $showimg->no_thumb = get_template_directory_uri() . '/images/default/noimage_336_220.png';

         $showimg->width = '336';

         $showimg->height = '220';

         $showimg->crop = true;

         $showimg->lazy = false;

         ?>

         <?php

         if ('post' == get_post_type($home_carousel->ID)) {

             $category = get_the_category();

    $category_id = $category[0]->term_id;

    $category_echo = $category_id;

         }

         else {$category_echo = ''; }

         ?>

         <div class="carousel-item tabcat-<?php echo ''.$category_echo;?>">

             <figure>

                 <a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>>

                  <img class="owl-lazy" data-src="<?php echo ''.$showimg->get_resized_url();?>" alt="<?php the_title_attribute(); ?>">

                 </a>

             </figure>

       <div class="text-oncarousel">

           <h3><a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php the_title();?></a></h3>

              <div class="post-meta"><?php if ('post' == get_post_type($home_carousel->ID)) {meta_small( false, $category_id, false, false );} ?></div>

              <?php rehub_create_btn('', 'price');?>

              <?php do_action( 'rehub_after_uni_carousel_text' ); ?>

          </div>

         </div>

         <?php endwhile; endif; wp_reset_query(); ?>

     </div>

 </div>

<?php else:?>

    <div class="post_carousel_block loading carousel-style-3 <?php echo ''.$disable_nav_class;?>">

        <div class="re_carousel" data-showrow="3" data-laizy="1" data-fullrow="2" <?php echo ''.$autodata;?> <?php echo ''.$disable_nav;?>>

         <?php $result_cat = array();

             $deal_carousel = new WP_Query($args);

             if( $deal_carousel->have_posts() ) :

             while($deal_carousel->have_posts()) : $deal_carousel->the_post();

          global $post;

         ?>

   <?php

   if ($aff_link == '1') {

       $link = rehub_create_affiliate_link ();

       $target = ' rel="nofollow" target="_blank"';

   }

   else {

       $link = get_the_permalink();

       $target = '';

   }

   ?>

            <?php

            $showimg = new WPSM_image_resizer();

            $showimg->use_thumb = true;

            $showimg->height = '120';

            $showimg->crop = true;

            $showimg->lazy = false;

         $showimg->no_thumb = get_template_directory_uri() . '/images/default/noimage_200_140.png';

            ?>

            <?php

            if ('post' == get_post_type($post->ID)) {

                $category = get_the_category();

                $category_id = $category[0]->term_id;

                $category_echo = $category_id;

            }

            else {$category_echo = ''; }

            ?>

            <div class="carouselhor-item">

                <div class="l-part-car">

                    <figure>

                        <a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>>

                            <img class="owl-lazy" height="120" data-src="<?php echo ''.$showimg->get_resized_url();?>" alt="<?php the_title_attribute(); ?>">

                        </a>

                    </figure>

                </div>

                <div class="r-part-car">

                    <?php echo getHotIconfire($post->ID);?><?php echo getHotLikeTitle($post->ID);?>

                    <h2><a href="<?php echo ''.$link;?>"<?php echo ''.$target;?>><?php echo wp_trim_words( get_the_title($post->ID), 8, '...' );?></a></h2>

                    <div class="post-meta"><?php if ('post' == get_post_type($post->ID)) {meta_small( false, $category_id, false, false );} ?></div>

                    <?php rehub_create_price_for_list($post->ID);?>

                    <?php do_action( 'rehub_after_recash_carousel_text' ); ?>

                </div>

            </div>

            <?php endwhile; endif; wp_reset_query(); ?>

        </div>

    </div>

<?php endif;?>

<?php

$output = ob_get_contents();

ob_end_clean();

return $output;

}

}



And change h2 for h4?

Igor Sunz Support Agent
3 weeks ago

you can't do this in such way. You must copy just function which you need from module shortcode and place it in functions.php

Ignacio Santiago
3 weeks ago

I had uploaded the file in my child theme (as you can see in the attachments) and changed the h2 to h4 in the "DEAL and POST CAROUSEL" section, but I still see the h2 title (not the h4).

Ex. https://estafados.red/estafometro/

Igor Sunz Support Agent
3 weeks ago
Ignacio Santiago
3 weeks ago

Tell me the file name please.

Igor Sunz Support Agent
3 weeks ago

I can point you file name if you know how to make customization. Otherwise,
webbizdirect@gmail.com if you need to hire developers

пн, 3 февр. 2020 г., 13:24 Sizam Support Help Desk <
sizamtheme+zK5On1rwJ7LY6kdGVpBR@mail.support-hub.io>:

Ignacio Santiago
3 weeks ago

Hi,

I would like to change Deal and Post Carrousel Title from H2 to H4.

Additional Info

Link on page with issue (Optional): https://estafados.red/