popular post shortcode title

This topic contains 19 replies, has 4 voices, and was last updated by  RITA 7 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #377867

    RITA
    Expired Member
    Post count: 119

    Works like a charm. Best support ever, as usual !

    Thank you again kiran.

    #377868

    Kiran
    Moderator
    Post count: 7069

    Thank you for letting us know 🙂

    #378049

    RITA
    Expired Member
    Post count: 119

    Hi,

    Sorry for coming back… but I’m trying to use your snippet (icon title) for more than one title and it always causes error. Can you help again please ?

    Edit : I finally find a solution but I don’t think is the best one… I change the function name for each title : gd_custom_ppv_sc_widget_title2, gd_custom_ppv_sc_widget_title3

    Do you think it is safe ?

    #378076

    Kiran
    Moderator
    Post count: 7069

    You can use same snippet code for all the widget. Try like this

    
    
    function gd_custom_ppv_sc_widget_title( $title ) {
        /*** Match 1 ***/
        $match_title = 'Offers'; // Your current title.
        $icon_element = '<i class="fa fa-hand-o-right" aria-hidden="true"></i>'; // Icon element for Offers.
    
        if ( $title == __( $match_title, 'geodirectory' ) ) {
            $title = $icon_element . '&nbsp;&nbsp;' . $title;
        }
        
        /*** Match 2 ***/
        $match_title = 'My Offers';
        $icon_element = '<i class="fa fa-hand-o-left" aria-hidden="true"></i>'; // Icon element for My Offers.
    
        if ( $title == __( $match_title, 'geodirectory' ) ) {
            $title = $icon_element . '&nbsp;&nbsp;' . $title;
        }
        
        /*** Match 3 ***/
        $match_title = 'Another Offers';
        $icon_element = '<i class="fa fa-check-square-o" aria-hidden="true"></i>'; // Icon element for Another Offers.
    
        if ( $title == __( $match_title, 'geodirectory' ) ) {
            $title = $icon_element . '&nbsp;&nbsp;' . $title;
        }
        
        return $title;
    }
    add_filter( 'widget_title', 'gd_custom_ppv_sc_widget_title', 10, 1 );

    Thanks

    #378079

    RITA
    Expired Member
    Post count: 119

    Better like this !
    Thanks Kiran

Viewing 5 posts - 16 through 20 (of 20 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket