Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php on line 6121
How to print shortcode title & category from shortcode in wordpress

Home Forums WordPress How to print shortcode title & category from shortcode in wordpress

Viewing 0 reply threads
  • Author
    Posts
    • #143
      avi
      Participant

      Add this code in functions.php file :

      $atts = shortcode_atts( array(
              'title' => null,
              'category_id' => null
          ), $atts);

      and after that you can use the given code for print the value where you want :

      echo $atts['title'];

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Scroll to Top