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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Please tell me how to escape the widget shortcode. There is a function: if (!function_exists('foo_do_shortcode')) { function foo_do_shortcode($name, $attrs = array()) { $special_chars = ...
ams team's user avatar
-1 votes
1 answer
70 views

I am trying to pass JSON content in a shortcode. But the double/single quotes are getting replaced by corresponding curly quotes. The result string cannot be decoded by json_decode for syntax error. ...
sariDon's user avatar
  • 283
0 votes
1 answer
59 views

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
0 votes
1 answer
48 views

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
0 votes
1 answer
64 views

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
1 vote
1 answer
71 views

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
  • 11
1 vote
1 answer
64 views

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
2 votes
1 answer
112 views

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
  • 173
1 vote
0 answers
52 views

I built a custom plugin for a website Using Divi and I am facing a problem right now getting it to display in the production environment of the website. Here are the details: Since you can't really ...
BrigantiumXIX's user avatar
0 votes
1 answer
84 views

I use a php function to create and add share buttons to specific places through a shortcode. It work's fine, but I'm getting this error: Warning: Array to string conversion in ...142-custom-shortcodes....
GKaplan's user avatar
0 votes
1 answer
299 views

I have a shortcode that I have been using for awhile that is suddenly causing a warning in WordPress 6.5 the error is "Warning: Array to string conversion in ... on line 109" - line 109 is ...
Dab0416's user avatar
0 votes
1 answer
71 views

I assigned my posts archive to a site on settings -> reading. I added a post thumbnail to this site, and i want to show the image with a shortcode i have written in my plugin. The problem is, that ...
LovinQuaQua's user avatar
0 votes
2 answers
90 views

I have an archive page to show each author domain.com/author. On the archive page for an author domain.com/author/john-doe I want to display few information like name, e-mail address and role like ...
Guillaume Sorel's user avatar
0 votes
1 answer
36 views

I have made a toggle button with short-code for dark/light mode code below function dark_light_toggle_button_shortcode() { ob_start(); ?> <!-- new button --> <div id="...
Atiq Rev's user avatar
1 vote
2 answers
763 views

Block markup generally works in included PHP files. I prefer to use PHP includes in many cases as I can do more interesting things with it than I can with a template file (.html). I've just ...
JDQ's user avatar
  • 159
-1 votes
1 answer
70 views

I have a cpt called "movie", and I set a target for writers to make 50,000 posts in 6 months. The question is... can I make a percentage of the results of the number of recent posts against ...
Tuagapat Manam's user avatar
0 votes
0 answers
42 views

I would like to build a shortcode looks like below. [employee_session trigger=session-popup-1 trigger_type=id in_dialog=1 employee=1] [employee_session trigger=session-popup-2 trigger_type=id ...
futureyoon's user avatar
0 votes
0 answers
33 views

I have a code: $products_query_params = array( 'post_type' => 'product', 'product_cat' => 18, ); return new WP_Query($products_query_params); I need it to get products. But it works ...
Wembley's user avatar
0 votes
1 answer
358 views

I am trying to learn web development and using WordPress to make a site. I have Event Calendar, and Event Tickets Plugins. The Event Tickets Plugin uses short code to generate a checkout page after ...
Schmeckle's user avatar
0 votes
1 answer
474 views

I want to create a shortcode of myself that outputs “blocks”. Level 1: Setting a pure text I know how to do a simple shortcode. Let’s take this example. add_shortcode( 'greet', 'myNiceShortCode' ); ...
Xavi Montero's user avatar
0 votes
1 answer
44 views

I'm trying to use shortcode in index.php but when I use PHP code in my shortcode, it displays out of shortcode structure. this HTML code works <?php echo do_shortcode('[myshortcode label="...
Dragut's user avatar
  • 173
0 votes
0 answers
54 views

This is a function by Tobias Keller for PRG Pattern Link Masking where title shortcode is link text. How то add image shortcode alternatively instead text ? $use_prg = new prg_pattern(); class ...
arteaster's user avatar
0 votes
0 answers
33 views

My theme has an option to display the tagline in logo area of the header (tagline added using theme Site Identity settings) Using CSS I can supplement the tagline with additional content (words etc). ...
Todd's user avatar
  • 31
1 vote
1 answer
112 views

I'm learning how to use short codes but I don't undrestand why WordPress keeps rendering broken paragraph tags. I created a file called wp-content/themes/twentytwentythree/templates/single.html with ...
learningtech's user avatar
0 votes
1 answer
2k views

I'm using Gutenberg editor and I want to add a shortcode (using XYZ PHP Code) that uses the post id to retrieve certain ACF value. I'm editing the home page where the last blog posts are shown, but I ...
Alvaro's user avatar
  • 161

1
2 3 4 5
56