- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by Mahesh.
-
AuthorPosts
-
April 21, 2016 at 4:52 pm #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 greatfulApril 21, 2016 at 5:09 pm #90085MaheshKeymaster@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,
MaheshMay 4, 2016 at 6:36 pm #91024[email protected]ParticipantThanks 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]’); ?>
May 5, 2016 at 9:40 am #91061MaheshKeymaster@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,
MaheshMay 7, 2016 at 7:47 am #91171[email protected]ParticipantThanks 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.May 8, 2016 at 9:50 am #91223MaheshKeymaster@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 incatch-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 -
AuthorPosts
- The topic ‘adding google translate buttons in the head’ is closed to new replies.