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
0answers
5 views

Order selector when using woocommerce products shortcode [on hold]

If I display products with shortcode like this: [products category="edesitok" pagination="true" limit="12" columns="3"] there is no sort order selector on the top of the list (for visitors) like "...
1
vote
1answer
31 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. [...
0
votes
0answers
16 views

Divi builder injects its shortcodes in the rest api

We use Divi themes and builder from elegantthemes.com, maybe the most popular theme ever. We are using the latest WordPress and Divi versions. The divi shortcodes appear in the rest api, as you can ...
0
votes
0answers
22 views

How to get after hash word from current page url

I've been developing a filtering with mixitup including hash url filtering support in Wordpress. But one of the task, I need to catch up the after hash word and have to pass it into pure php string as ...
0
votes
0answers
26 views

Adding wordpress taxonomy name on a list table in the post with shortcode

Hi there I have constructed a function that return taxonomy post term array by using (wp_get_post_terms function) in wordpress. I added this function to the functions.php file of my custom theme ...
1
vote
0answers
12 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
0answers
19 views

plugins replacement in wordpress

I am working on a website (built on wordpress) in which I want to replace some plugins. The name of the plugin which I want to replace is Accordion Shortcodes. I am wondering what best practice I need ...
0
votes
2answers
21 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" ...
0
votes
0answers
11 views

Multiple shortcodes on the same page but with different parameters

I'm currently trying to install a Neori theme using these instructions: http://litmotion.net/documentation/neori/ So it says if I want to use Slice Type 1, I need to insert this shortcode: [...
1
vote
1answer
25 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
16 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
22 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
21 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
42 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
17 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
33 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', '...
0
votes
0answers
12 views

Is it possible to change existing shortcode?

There's a theme using cornerstone visual composer and it's shortcode [recent_posts]. I want to change it's behoviour, because it sets featured image as background in the following way: <div style="...
0
votes
1answer
24 views

Instagram URL is converted into oEmbed

I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes. I'm using Gutenberg's Instagram embed blog to add the URL's.https://blog.wwf.sg/ocean/2018/11/netflix-...
-1
votes
1answer
18 views

A number appears inside a div called wpb_wrapper, when I use a custom shortcode

the page automatically display a number inside a div called wpb_wrapper, when I use a custom shortcode. but its nowhere in my function. When I delete the shortcode the number goes away. <div class=...
0
votes
2answers
24 views

Cant display an image via PHP in wordpress

I have a strange problem, when I try to enter the source of an image tag using PHP it shows me the following error in the inspector <img src=(unknown) alt=""> this code fragment gives me the ...
-1
votes
0answers
14 views

add_to_cart_url shortcode adding another product on refresh

I am currently displaying an 'Add To Cart' button in WooCommerce for a variation using a shortcode like this... [add_to_cart_url id="746"] This is working correctly, but now if the customer clicks ...
-1
votes
1answer
12 views

Does anyone recognize shortcode ig_special_heading?

Does anyone recognize the shortcode [ig_special_heading] and can tell me what plugin or theme it comes from?
0
votes
1answer
15 views

Shortcode to pull posts

I need some help please. I have created a shortcode to pull in posts, then using ajax it loads more posts. I have everything working but it is duplicating the first group of posts. below is my code. ...
1
vote
1answer
62 views

Shortcode returns escaped HTML tags

To put things in context, I'm using Gantry on WordPress, which is bundled with Timber and Twig. I have this code, basic, make-your-text-bold shortcode // Add Shortcode function bold_text_shortcode( $...
0
votes
1answer
23 views

Shortcode attributes causes 500 error after updating the page

I have created a shortcode that allows me to pass an attribute like so [product_swatch swatchtype="swatch"]. It works fine on the front end, but every time I update the page it leads to a 500 error. ...
0
votes
0answers
12 views

shortcode atts pagination

I'm trying to have the shortcode_atts published to me on several pages but I cant do it, any suggestions? public function upme_favorite_posts_list($atts){ global $post,$wpdb,$upme_options; ...
0
votes
1answer
43 views

Shortcode not working - quotes seems strange

I have been through other posts and tried a lot. I have two wordpress sites on the same server and A runs fine with the plugin "PHP code snippets" but B just shows the shortcode [wbcr_php_snippet id=”...
0
votes
1answer
12 views

Load custom post type with ID in a shortcode

I develop a theme for the first time. I created a custom post type for banners/call to actions that I want to include in different posts with a shortcode. The shortcode should look like [banner id=123]...
-1
votes
0answers
20 views

Shortcodes Ultimate lightbox content on a different page than its referring page

I am a novice in HTML, WordPress, and coding. My questions are strictly bound to Wordpress and Shortcodes Ultimate plug-in. I maintain a website which uses; Wordpress: version 4.6.12 Theme: ...
0
votes
0answers
24 views

Shortcode not working with AJAX Wordpress plugin

Problem: Some one else had the same problem but solution did not work for me Two: Is your shortcode in your main plugin file. If that code is in another file inside your plugin, did you make sure ...
0
votes
2answers
20 views

Do_shortcode before send email content

I'm having a little problem figuring out how to execute shortcodes stored in a mail content option of a plugin. The thing is, I have a field in my options page named '_message' that works with ...
0
votes
0answers
19 views

Use audio tag with FTP address?

Can anyone tell me why I can't use a FTP address in the Audio shortcode? It's simply not playing... [audio src="ftp://domain.no-ip.org/file.mp3"] PS; when going to the address (above is not a real ...
0
votes
1answer
15 views

Gallery shortcode is empty but magically creates a gallery

I have a post with only this [gallery id="file"] in text editor but in visual, there appears a gallery. I was moving these posts and updating gallery ids automatically, but these posts don't have any ...
1
vote
1answer
24 views

Shortcode created to check language not works

i need to create a shortcode to display a different Div depending on WP current language only when users are logout. The shortcode is this one: function coupon_box() { $user = is_user_logged_in() ; ...
-1
votes
1answer
24 views

How to Create Short Code Using Custom Post type

I am New To Wordpress Plugin Development. I want to Create Short Code using Custom Post Type Method function baztag_func( $atts, $content = "" ) { return "content = $content"; } add_shortcode( '...
0
votes
1answer
18 views

get_posts works in the page template but not in a shortcode

I am trying to write a shortcode, which includes 'get_posts' in order to get the blog posts data and then display the 3 most recent on the page. This code works within the template. However, when I ...
0
votes
1answer
13 views

Shortcodes output in the wrong order

I have two shortcodes that i'm using for copyright information. // Year shortcode function year_shortcode() { $year = the_time('Y'); return $year; } add_shortcode( 'year', 'year_shortcode' ); ...
4
votes
2answers
94 views

enqueue script for specific shortcode

I've created some shortcodes and for some of these, I need to load particular scripts on demand. I've included by default in my function.php file vendor.js myscript.js When i load the shortcode, i ...
0
votes
2answers
29 views

Short code inside the page not working in WordPress

Ex. I used a short code [dropcap] I know you're better than me[/dropcap] When I updated the page and view the website same is showing on page [dropcap] I know you're better than me[/dropcap]
1
vote
1answer
68 views

How do I write a shortcode that opens and closes?

I want to have a shortcode like this: [readmore]Lorem ipsum dolor sit amet, consectetur adipiscing elit...[/readmore]
0
votes
0answers
18 views

Need to insert custom shortcode to replace theme search

I'm using ajax search pro and the replace search feature (which replaces current search with new ajax isnt working.) I'm trying to replace it but I'm not 100% where to put the short code. Theres a ...
0
votes
0answers
41 views

Need to display only subcategory content

I have no idea how coding works and wondered if someone can assist. I am busy setting up my website and i am using DIVI Theme, I have been using a code i got online to display parent categories on ...
0
votes
1answer
39 views

Run shortcode in custom script in wp_head if post type is CPT 'Jobs'

i am using genesis framework and types plugin. i create post meta fields for a custom post type name 'jobs' i want to run a custom javascript named jobpostingschema.js in wp_head if post type is ...
1
vote
2answers
39 views

shortcode is not working in homepage page template(custom front page)

Shortcode of MailChimp subscribe form in theme's custom homepage is not working but when i put same shortcode in blog page and other pages then its working I put [mc4wp_form id="id"] this shortcode ...
0
votes
1answer
31 views

Omit specific product categories from WooCommerce shortcode

I assumed this would be simple, but I'm having a hard time sorting it out. All I want to do is use the standard [product_categories] shortcode from WooCommerce to show all of my product categories ...
0
votes
0answers
19 views

how do i add a subscription form to all my blog posts using the landing.php Template in oceamWp?

I am using a sendinblue plugin for my subscription forms. I have a short_code and I want it on top of all my Blog posts. I tried to add it to the landing.php page like bellow <div id="content" ...
0
votes
1answer
20 views

How can i access woocommerce order variables inside shortcode?

I am adding a shortcode from wordpress to woocommerce email template. do_shortcode('[sample_test name="additional_gift_msg"]); Then i am using this to display the value in email. I am able to ...
0
votes
1answer
20 views

Remove a short code and update it's content (AJAX)

This is my code function ajax_layoutcontrol(){ if( !check_ajax_referer( 'special-string','security')){ return wp_send_json_error( 'Invalid nounce'); } if (! current_user_can('...
2
votes
1answer
42 views

If numberposts = -1 offset won't work

I have an issue with a shortcode I have built. The short code pulls the most recent posts based off of certain parameters. below are the parameters extract( shortcode_atts( array ( 'numberposts' ...
0
votes
0answers
33 views

Get posts by id using shortcode

I am trying to get posts by id using shortcode [testimonials id="272"] in functions.php file. I used the below code it is working but not able to get posts by id. Can anyone help me with this issue if ...