WordPress

How To Extend Parent Theme Shortcode Into Child Theme In WordPress Or Extend Any Plugins Shortcode Into Theme File

Here we learn about how to extend parent theme shortcode into a child theme in WordPress or extend any plugins shortcode into the theme file.

Custom code copied and paste into your child theme’s functions.php file.

Here I have ‘site_icon_text’ shortcode into my parent theme.

<?php
add_action('init', 'remove_parent_no_icon_text');
function remove_parent_no_icon_text() { 
  // I remove shortcode of parent theme
  remove_shortcode( 'site_icon_text' );
  
  // Initialize child theme shortcode for changes into render
  add_shortcode( 'site_icon_text', 'myblog_extend_no_icon_text' );
}

function myblog_extend_no_icon_text() {
  // shortcode render here
}
?>

 

Rahul Prajapat

I’m Rahul Prajapat. I’m a WordPress developer and Author at TheCodeHubs. I have good skill of Html, CSS, JQuery, SQL, Web API, PSD to HTML/PSD to WordPress, WordPress Theme/Plugin Customization, create or modify short code, customize visual composer short code or integrate new short code with visual composer, can create custom metabox for any post type in WordPress admin.

Share
Published by
Rahul Prajapat

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

2 years ago