Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Create custom shortcode or widget in child theme functions.php

    • 10 years, 4 months ago ivo
      Participant

      Expired

      I’m trying to create a custom shortcode or custom widget in de functions.php child of my child theme. But this is not working.

      I have this basic code:

      // Add Shortcode
      function custom_shortcode() {
      
      // Code
      echo 'test';
      }
      add_shortcode( 'lotcategories', 'custom_shortcode' );

      But when I add the shortcode [lotcategories] to a page only the tag is showing

      Can you help me out with this?

    • 10 years, 4 months ago Ruco
      Keymaster

      Hello,

      If you want to create new shortcodes you must edit the files:

      specular\includes\core\shortcodes\mce\editor_plugin.js
      specular\includes\register\register_shortcodes.php
      specular\includes\core\shortcodes\sc – add another .js file for your shortcode.

      Best regards!

    • 10 years, 4 months ago ivo
      Participant

      Expired

      How can i do this within my child theme? Otherwhise I have to copy the shortcode codes with every update

    • 10 years, 4 months ago Mirela
      Participant

      Hello,

      Yes, you can do it from child theme. Just add the code above into your child theme’s functions.php file.

      Best regards!

Viewing 3 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password