Skip to main content

Questions tagged [shortcode]

BB-Code-like mechanism by which strings enclosed in square brackets can serve as shorthand for longer and more complicated strings. These strings are processed by callback handlers, usually on page load, which replace the bracket enclosed string with the output from the callback handler.

0votes
1answer
30views

How to display a function inside shortcode tags

I need to display a function inside shortcode tags, but my function displays outside shortcode tags. How could I display my function inside shortcode tags? my function: function myFunction() { ...
user9637601's user avatar
1vote
1answer
44views

$m in pre_do_shortcode_tag

What is the $m parameter of pre_do_shortcode_tag? var_dump($m) shows for example: array(7) { [0]=> string(32) "[gallery id="123" size="medium"]" [1]=> ...
pehu's user avatar
0votes
1answer
18views

What's the syntax for embedding a Goggle sheet in a shortcode?

I want to embed data from a Google sheet in a Wordpress page. As far as I understand, the easiest is to do it inside an iframe, but that requires that I buy some plugin. Alternatively, one can use a ...
Francesco Potortì's user avatar
1vote
0answers
58views

Shortcode in loop always display data of first post on the page

I am creating a shortcode to fetch the categories of a given post and display them in a stylish way. I made the following shortcode: function t3_categories_fonction(){ global $post; // Get the ...
user28551593's user avatar
0votes
1answer
35views

Disable / hide example preview using elementor editor on page with shortcode

Hello wordpress developers. I have created a plugin that allows me to insert content on a page by using a shortcode, the content is rather long since it is an list of data. When editing the page with ...
Michael Aggerholm's user avatar
1vote
1answer
44views

Trying to create a shortcode that displays taxonomy terms in a dropdown

I have a snippet that displays all terms from specified taxonomy in a drop down menu. The code works perfectly when it's hardcoded but I am struggling to get it to work as a custom shortcode. The ...
user1048696's user avatar
1vote
1answer
48views

How to use Shortcodes?

I have created this shortcode in my child theme's function.php: function display_product_stock_with_text() { global $product; // Access the global WooCommerce product object if ( ! is_product(...
Meeth's user avatar
0votes
1answer
40views

How to allow shortcodes in image descriptions?

I understand how to add a filter to enable shortcodes for something: add_filter( 'img_description', 'do_shortcode' ); But, what's the actual hook to target image descriptions? img_description doesn't ...
WPdummy's user avatar
1vote
1answer
43views

Using a shortcode to get User Emails by role as specified in the shortcode, need help to allow for multiple roles

I have the following working code: function get_emails_by_multiple_roles ( $atts ) { $user_args = shortcode_atts ( array ( 'role' => 'role' , ), $atts ); $users = get_users( $...
Troy Rash's user avatar
0votes
0answers
12views

AAPF Filter group is not in widget section

as i am trying this plugin for my website AAPF Filter group is not showing in my widget section, if i use this short code also it doesn't working [br_filters_group group_id=2661]
john's user avatar
0votes
2answers
58views

Automatically populating a date parameter within a shortcode

On one of my sites, I use Formidable Forms. I need monthly numbers (simple counts) on submissions for these forms. My current solution is to use this shortcode built-in from Formidable: [frm-stats id=...
MidPiedmont's user avatar
2votes
1answer
78views

How to create a three column blog layout with a single query and with three different classes?

I am trying to achieve the following layout : I have created a shortcode for this but I am not getting the desired result. Can anyone guide me where I am getting it wrong. Here is full shortcode. ...
kalyan's user avatar
0votes
0answers
32views

How can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?

I am using a custom page template in the "twenty twenty-three" theme. I am using a shortcode block as part of the template. This results in the shortcode not running within "the_content&...
Scott H's user avatar
0votes
0answers
37views

Shortcode to return data instead of outputting HTML?

I’ve got a shortcode plugin which allows me to output a block of HTML in one of a few different formats based on parameters. [mm-postlinking] [mm-postlinking id="281493" template="...
commadelimited's user avatar
0votes
0answers
25views

Add Shortcode functionality to a function that queries custom post type / taxonomy

How to output a UL of items and URLS for custom taxonomy? The plugin 'CPT UI' (Custom Post Type UI) is very good at creating custom post types. I have created a post type called 'Towns' that has a ...
Adam Fletcher's user avatar

153050per page
close