Social share sidebar

This topic contains 6 replies, has 3 voices, and was last updated by  Kiran 6 years, 6 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #427176

    Joy
    Buyer
    Post count: 1076

    How do I replace the images found here with font awesome icons?

    https://wpgeo.directory/starter/places/united-states/pennsylvania/philadelphia/restaurants/buddakan/

    Thank you.

    #427178

    Paolo
    Site Admin
    Post count: 31206

    There is no option to do that.

    The only way would be to change them with a custom function and a filter: https://wpgeodirectory.com/codex/?post_type=codex_creator&s=geodir_social_sharing_buttons&codex_project=0

    This is a customization

    Thanks

    #427179

    Joy
    Buyer
    Post count: 1076

    Ok, I will try to figure this out. Thank you.

    #427181

    Joy
    Buyer
    Post count: 1076

    Hi again. Is there a way I can just hook the supreme social code into the directory starter? I looked at the link but I don’t see where the images can be swapped out. The code is definitely not at clear as it is here:

    
    
    <ul class="sd-cta-favsandshare">
                        <?php if (!$preview) { ?>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Facebook', 'supreme-directory'); ?>"
                                   href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php urlencode(the_title()); ?>"><i
                                        class="fa fa-facebook"></i></a></li>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Twitter', 'supreme-directory'); ?>"
                                   href="http://twitter.com/share?text=<?php echo urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')); ?>&url=<?php echo urlencode(get_the_permalink()); ?>"><i
                                        class="fa fa-twitter"></i></a></li>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Google Plus', 'supreme-directory'); ?>"
                                   href="https://plus.google.com/share?url=<?php echo urlencode(get_the_permalink()); ?>"><i
                                        class="fa fa-google-plus"></i></a></li>
                        <?php } else { ?>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Facebook', 'supreme-directory'); ?>"
                                   href=""><i class="fa fa-facebook"></i></a></li>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Twitter', 'supreme-directory'); ?>"
                                   href=""><i class="fa fa-twitter"></i></a></li>
                            <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Google Plus', 'supreme-directory'); ?>"
                                   href=""><i class="fa fa-google-plus"></i></a></li>
                        <?php } ?>
                    </ul>
    #427183

    Paolo
    Site Admin
    Post count: 31206
    This reply has been marked as private.
    #427184

    Joy
    Buyer
    Post count: 1076

    Sorry, nevermind.

    #427199

    Kiran
    Moderator
    Post count: 7069

    Hi Joy,

    Add following code snippet in your theme functions .php file or add code via snippet plugin.

    
    
    function _gd_custom_fontawesome_social_sharing_buttons( $content = '' ) {
    	if ( ! ( geodir_is_page( 'detail' ) || geodir_is_page( 'detail' ) ) ) {
    		return $content;
    	}
    	ob_start();
    	?>
    	<div class="geodir-company_info geodir-details-sidebar-social-sharing">
    		<div class="gd-custom-fa-share">
    		<style> .gd-custom-fa-share { text-align: center; } .gd-custom-fa-share a { margin: 0 7px; font-size: 1.25em; } </style>
    		<?php if ( geodir_is_page( 'preview' ) ) { ?>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Facebook', 'geodirectory' ); ?>" href=""><i class="fa fa-facebook"></i></a>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Twitter', 'geodirectory' ); ?>" href=""><i class="fa fa-twitter"></i></a>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Google Plus', 'geodirectory' ); ?>" href=""><i class="fa fa-google-plus"></i></a>
    		<?php } else { ?>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Facebook', 'geodirectory' ); ?>" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php urlencode( the_title() ); ?>"><i class="fa fa-facebook"></i></a>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Twitter', 'geodirectory' ); ?>" href="http://twitter.com/share?text=<?php echo urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) ); ?>&url=<?php echo urlencode( get_the_permalink() ); ?>"><i class="fa fa-twitter"></i></a>
    			<a rel="nofollow" target="_blank" title="<?php echo __( 'Share on Google Plus', 'geodirectory' ); ?>" href="https://plus.google.com/share?url=<?php echo urlencode( get_the_permalink() ); ?>"><i class="fa fa-google-plus"></i></a>
    		<?php } ?>
    		</div>
    	</div>
    	<?php
    
    	$content = ob_get_clean();
    	return $content;
    }
    add_filter( 'geodir_social_sharing_buttons_html', '_gd_custom_fontawesome_social_sharing_buttons', 10, 1 );

    Thanks,
    Kiran

Viewing 7 posts - 1 through 7 (of 7 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount