Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #90083
    [email protected]
    Participant

    hi,

    I am looking to add google translate buttons in the head and replace it with the social media buttons
    tried and could not get it done, any help will be greatful

    http://www.nanomagtech.com/

    #90085
    Mahesh
    Keymaster

    @nagesh-seogmail-com: Are you trying to add the buttons with plugin or just the links/codes? Since in Catch Responsive Free, header right section comes directly through code and the content cannot be modified through dashboard, you’ll need to create a child theme and override the following function.

    function catchresponsive_header_right() { ?>
    	<aside class="sidebar sidebar-header-right widget-area">
    		<section class="widget widget_search" id="header-right-search">
    			<div class="widget-wrap">
    				<?php echo get_search_form(); ?>
    			</div>
    		</section>
    		<?php if ( '' != ( $catchresponsive_social_icons = catchresponsive_get_social_icons() ) ) { ?>
    			<section class="widget widget_catchresponsive_social_icons" id="header-right-social-icons">
    				<div class="widget-wrap">
    					<?php echo $catchresponsive_social_icons; ?>
    				</div><!-- .widget-wrap -->
    			</section><!-- #header-right-social-icons -->
    		<?php
    		} ?>
    	</aside><!-- .sidebar .header-sidebar .widget-area -->
    <?php
    }

    Note: You can find more on creating child theme HERE.

    Regards,
    Mahesh

    #91024
    [email protected]
    Participant

    Thanks Mahesh, But i am unable to figure out which page to change? (header.php, or )

    The plugin is Google Language Translator and the short code is [GTranslate]

    I think i need to add this code in header.

    <?php echo do_shortcode(‘[GTranslate]’); ?>

    #91061
    Mahesh
    Keymaster

    @nagesh-seogmail-com: Overriding above function will fix the issue, no need to edit other files. In the above code, replace the following code

    <?php if ( '' != ( $catchresponsive_social_icons = catchresponsive_get_social_icons() ) ) { ?>
        <section class="widget widget_catchresponsive_social_icons" id="header-right-social-icons">
            <div class="widget-wrap">
                <?php echo $catchresponsive_social_icons; ?>
            </div><!-- .widget-wrap -->
        </section><!-- #header-right-social-icons -->
    <?php
    } ?>

    with the following:
    <?php echo do_shortcode(‘[GTranslate]’); ?>
    However, you may need to change some CSS if some design issue occur.
    Hope this helps, let me know if any problem.

    Regards,
    Mahesh

    #91171
    [email protected]
    Participant

    Thanks for your response mahesh, but i am still unable to “override the functions”
    haven’t done it before. if you can please help me with where to copy and paste in which file, it will he helpful.
    I am complete nerd in wordpress.

    #91223
    Mahesh
    Keymaster

    @nagesh-seogmail-com: First you must create a child theme. For more details on creating child theme, go to this LINK. Then in your child theme’s functions.php, copy and paste the above function i.e. catchresponsive_header_right (you can find the function in catch-responsive/inc/catchresponsive-structure.php file). Then in the function, replace the following code with the Gtranslate’s shortcode:

    <?php if ( '' != ( $catchresponsive_social_icons = catchresponsive_get_social_icons() ) ) { ?>
        <section class="widget widget_catchresponsive_social_icons" id="header-right-social-icons">
            <div class="widget-wrap">
                <?php echo $catchresponsive_social_icons; ?>
            </div><!-- .widget-wrap -->
        </section><!-- #header-right-social-icons -->
    <?php
    } ?>

    Replace With the following:
    <?php echo do_shortcode(‘[GTranslate]’); ?>
    Hope this helps.
    If you are not much familiar with coding, I recommend you to hire a customizer.

    Regards,
    Mahesh

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘adding google translate buttons in the head’ is closed to new replies.