Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
12 views

Default Wordpress shortcodes not working?

For whatever reason, the WP shortcodes don't seem to be working. I'm using the theme Verbosa, on the off-chance that matters. When creating a custom page, the shortcodes are just rendering as text ...
0
votes
1answer
14 views

How to take shortcode and content separately from a page?

I have a page with content and shortcode for the contact form. I want to display the content of the page in one div and the shortcode in another div(that means the form should render in another div). ...
0
votes
0answers
25 views

Multiple values for one variable

I have a custom plugin that was written by someone, I can't reach anymore. It has a search option, that produces a table with seminars in different cities. Right now I can have a query with this ...
0
votes
1answer
26 views

How to add “get_theme_mod” inside a shortcode?

I want to make dynamic the content inside a shortcode so I can modify it in the customizer. I created the customizer tabs. Now, I want to create a shortcode to place it anywhere in the page while ...
0
votes
0answers
19 views

How to create a TinyMCE dropdown with dynamically generated shortcodes

Is it possible to create a TinyMCE dropdown menu with dynamically generated shortcodes? This is my code for shortcodes: function filter_button_group($atts){ $attributes = shortcode_atts( array( ...
-1
votes
0answers
16 views

I'm failing to replace the demo-content placeholder image regardless of editing the shortcode [closed]

I have been trying for quite sometime to change the demo-content placeholder image by editing the short-code but no progress, I literally just replaced the image link in the short-code with my full ...
-1
votes
0answers
23 views

shortcode being fired when saving post

I am having trouble with short code being executed when a post is saving. I have stripped everything down to the bare minimum and am still having the issue. Also, and it might be related, is_admin() ...
0
votes
0answers
19 views

Detecting embeded video format

I need to get the video format from the shortcode. Example if i set my post meta "_video_format_embed" with [video src="https://url.domain/myvideo.mp4" /] . how to get the video format of my ...
0
votes
1answer
18 views

Is it possible to change a shortcode parameter based on a media query?

I'm using a show/hide plugin that has shortcode with a parameter with state="open" or state = "closed" I would like to have it open on desktop but closed on mobile. Is it possible to change this ...
1
vote
1answer
12 views

How to create shortcode to display custom field value on a custom post type

in my ad site I was trying to create shortcode of some custom fields I created on a custom post type. I'll explain In the single post, there are the custom fields and are shown in a standard way in ...
0
votes
0answers
11 views

Shortcode inside of another shortcode (HELP?)

I am having trouble with shortcodes working. My example shortcode I use in wordpress post [agt] Resistance Bands Ideal Hip Band Heavy & Light Users for Squat Exercises - Elite Abductor Sling for ...
0
votes
1answer
16 views

How to add new images to existing shortcode configuration?

How would I go about adding/updating images and content to an existing gallery with established shortcode? Not the most Wordpress savvy but I'd love to be able to make some changes to a site that ...
-1
votes
1answer
21 views

related articles using shortcodes

I want to make related articles based on the categories in the sidebar using shortcodes so that they can be placed anywhere. can you help me? thanks before.
0
votes
0answers
24 views

how to format / execute post content and shortcode?

<div id="primary" class="content-area"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', 'page' ); ...
-1
votes
0answers
39 views

calling a shortcode from javascript wordpress

I have read numerous other posts both here and elsewhere and I understand one cannot simply call the shortcode from javascript - one has to use AJAX - now I have begun to use AJAX to call my bespoke ...
1
vote
2answers
13 views

Shortcodes in excerpts returning empty string

I got this code: function ntt_movie_shortcode($atts, $content = null) { return 'TEST'; } add_shortcode('ntt_movie', 'ntt_movie_shortcode'); The shortcode works perfectly on a single page, but on ...
0
votes
0answers
43 views

Gutenberg Block with Select from JSON-File

I would like to create a block for Gutenberg. I currently have a default configuration: function my_block_category($categories, $post) { return array_merge( $categories, array( ...
0
votes
0answers
18 views

The shortcodes are not displayed on the page

i have 2 theme for my site and have wp-poll plugin. in Pinboard theme my poll is ok and show polls. but in pinthis theme only showed short code
0
votes
0answers
32 views

enable shortcode in woocommerce short product description on archive page

I'm using a shortcode in the woocommerce "Product short description" field. It displays fine on a single product page, but I need it to fire on the archive page as well. On that page, the shortcode ...
0
votes
1answer
23 views

CPT in a shortcode

I'm having trouble with putting my custom post type content in the shortcode and was wondering can someone help me with this. I need this in shortcode: // List judges shortcode function ...
-2
votes
1answer
41 views

Display Current Time using shortcode

I am using the below code to display current time in php supported time zones: <?php date_default_timezone_set('Asia/Kolkata'); $currentTime = date( 'd-m-Y h:i:s A', time () ); echo $currentTime; ...
0
votes
0answers
40 views

How to pass data to shortcode via form

I have custom post type called "forms" and has a sub-menu page which has form, to add a name add_action('admin_menu', 'form_builder_add'); function form_builder_add() { //create new top-level ...
1
vote
0answers
15 views

add action only if gallery shortcode attribute is equal to?

I'm customizing the gallery shortcode. Now, when the user clicks on edit button as shown below: We can see the gallery modal like below: In the right sidebar, we can see the gallery settings. And I ...
1
vote
1answer
14 views

While loop shortcode problem

I have created a shortcode using the while loop, which is going to break the loop when used with the page builder. How to solve it. Here may custom shortcode here my showing part
0
votes
0answers
14 views

Shortcode cannot be found

I have a shortcode somewhere on my blog that I cannot find and I need to delete. It only shows up when I am looking at my website on a mobile device. It does not show up on tablet or laptop.
0
votes
1answer
40 views

Plugin echos text from shortcode function in gutenberg page editor

I'm creating a plugin to load custom posts by custom taxonomy (restaurant menu plugin).. I'm calling the main function (holds everything) by the add_action hook on 'init' and inside it I have another ...
0
votes
1answer
18 views

How do I point bloginfo('stylesheet_directory') to my parent theme?

I've created a child theme but the parent theme seems to use bloginfo('stylesheet_directory') to point to a lot of CSS and js files, none of which are currently loading. As I believe the '...
0
votes
0answers
11 views

How to use widget options as a shortcode?

I have function that convert widget options to shortcodes args. abstract class MOD_Widget extends WP_Widget { [...] [...] public function params_to_shortcode( $params ) { $...
0
votes
1answer
31 views

Can I use shortcodes in mail body

Can I put any type of custom shortcode for some content in mail body? eg: $to = "test@test.com"; $subject = "Test Email"; $packages = do_shortcode('[test id="0000"]'); $message = $packages; // ...
0
votes
0answers
24 views

How can I disable(remove) wpautop (wptexturize, convert_chars) for specific shortcodes only?

I am having a trouble in disabling formatting for specific shortcode. For example, I have: [MyTag]"hi"[/MyTag] However, the output is “hi“ (note the formatted quotes). I want to disable any kind of ...
0
votes
1answer
16 views

How to include any template using Shortcode fuction?

function custom_code(){ return include( get_stylesheet_directory() . '/custom-template.php'); } add_shortcode('custom_shortcode','custom_code'); As you can check above I want to include a ...
0
votes
1answer
49 views

Shortcode to Gutenberg-block: additional text on front-end and conditional display

I'm working to translate a custom shortcode to a Gutenberg-block but am stuck on two issues. This post first treats the current situation, the next heading shows the problems I'm running into in ...
0
votes
1answer
46 views

Wordpress functions.php shortcode is not working [closed]

I have new WordPress (5.0.2) install with the code added to the end of functions.php file: function testsc(){ return "It is working!"; } function testsc2(){ return "It is working!"; } ...
0
votes
1answer
65 views

Wordpress shortcode doesn't working on HomePage

What I want to do is make my Home Page. I can do it this way: Create a page and insert my gallery from plugin with that code [wonderplugin_gridgallery id=1] Set that page as HomePage. BUT THAT IS ...
0
votes
0answers
21 views

Short code stripping HTML

I'm using short codes of my own and I realised that it strips some html code away and messes up with what I wrote in my code. Let's start with an example. In Wordpress I add [myshortcode id="99"] ...
0
votes
1answer
63 views

Trigger popup in a php if/else statement

I am trying to trigger a popup within functions.php if certain conditions are met. The if else statement it self works perfectly, but I can't get the popup to open. I've tried calling a shortcode but ...
0
votes
1answer
33 views

How to load specific template page in a custom shortcode

I'm using a theme for my WP site that has its own registration page template (register.php). I'm trying to create a shortcode that will load that template wherever I want, but I can't make it work. ...
0
votes
0answers
25 views

Content included from pagination

I appreciate if someone can help me to explain why my post content shows below the pagination even though I echo the title only. I call this code via shortcode. INPUT: // the query to set the ...
0
votes
1answer
27 views

PHP/CSS: Shortcode won't display correctly, and only displays in the head (before content)

Trying to create a shortcode to be implemented to a popup. I'm trying to display four images in a 2x2 grid at the center of the page. The problem is that this shortcode now floats everything left and ...
0
votes
0answers
16 views

How to Get Parent Category from attchment post with Plugin: Custom Content Shortcode

Im using "Plugin: Custom Content Shortcode " on my site . Just stuck with my code here. Im using short code on custom post with pods on my site. im going to display images from posts if image title ...
1
vote
1answer
38 views

SEO Friendly URL on dynamic product page produced via shortcode

I have created a product page in wordpress, /product. This currently takes the id of a product /product/?id=123 The page has a shortcode that then fetches and displays the relevent data e.g. [...
1
vote
0answers
13 views

How to display all subpages and short by year

How can I display all child-pages and short by year in Wordpress For example: all subpages in 2016, 2017, 2018: • 2018: ----- Subpage A ----- Subpage B ----- Subpage C • 2017: ----- ...
0
votes
2answers
27 views

Video Short Code and Media Fragments URI

It looks like Wordpress video short code does not support media fragments URI (.e.g. appending #t=10 for the video src for example), so something like this wont work: [video width="854" height="480" ...
1
vote
3answers
197 views

Add custom variable in Contact Form 7 mail body

I set cookie for my users to know from which source they come to the site and I want when user contact us their message comes with their cookie as well. So that I created a new shortcode and added in ...
0
votes
0answers
173 views

Offset with ajax load more posts duplicates

I have a shortcode that gets posts. I am using the shortcode three times on the page. The first time I grab the first 6 posts, the second time I offset by 6 and grab the next 4 posts, the third time I ...
0
votes
1answer
24 views

Unknow shortcode read on display site

I put the caption on a picture like this, the blog looks good, but in the compact view, I receive this problem I guess the editor can not read the HTML tag, Is anyone know what happened?
0
votes
1answer
39 views

Wordpress 302 Redirect to Random Product/Post/Page

I'm trying to add the ability to redirect a user to a random product/page/post url similar to example.com/page/random which would redirect to example.com/page/oneofmany. This question is not ...
0
votes
1answer
47 views

Wordpress keeps automatically inserts <br/>

I'm using the 'SyntaxHighlighter Evolved' plugin on Wordpress and when I create a code block, it keeps inserting a <br/>. If I put everything on one line, of course, it would not insert them. I ...
0
votes
1answer
21 views

How can I pass a shortcode value to the head in wordpress functions.php

I'm trying to create a shortcode for charts on wordpress posts. So far I've got the shortcode working and I can see the shortcode values are being passed through, but what I need to know is how to ...
0
votes
1answer
46 views

Shortcodes in billing fields doesn't work

WooCommerce: 3.5.1 WordPress: 4.9.8 I want to set automaticly billing fields with data from GeoIP shortcodes, but it doesn't work. add_filter( 'woocommerce_checkout_fields', '...