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

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.

-1
votes
1answer
10 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
0answers
8 views

AMCharts only display on page reload [on hold]

I am working on adding an SVG map to a page in WordPress. I can display the map with the AMCharts plugin but when I navigate to a new page then back to the page with the map on it, it no longer ...
0
votes
1answer
12 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
37 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
0answers
18 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
10 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
35 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
11 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]...
0
votes
0answers
15 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
20 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
14 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
22 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
16 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
12 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
90 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
67 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
15 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
27 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
33 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
34 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
26 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
17 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
19 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
19 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
41 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
31 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 ...
1
vote
1answer
33 views

Possible to display shortcode based on the category?

So, aside from creating individual WordPress Category PHP Pages, I'd much rather have a functions.php command that would insert shortcode when a Category has been selected. How would I go about that, ...
0
votes
0answers
13 views

Menu button to swap out shortcode somewhere else on page - is that possible?

Using WordPress 4.9.8, Windows 10 and Elementor Pro 2.1.9 plugin I’m very new to WordPress. I like to have a menu button that when activated replaces an iframe [shortcode] within the current page ...
1
vote
0answers
27 views

Reloading a Mediaelement audio player

I am writing a WordPress plugin (private and not intended to be publicly available) in which I am displaying a huge list of audio files (about a thousand) along with ONE audio player (like the one ...
0
votes
0answers
20 views

How can I display a desired date into a Wordpress page?

This question was posted on Stack OverFlow first. Discovering this Stack for WP Devs, I'm posting here too. Sorry if I should not duplicate. I'm trying to find a way to choose a date and display it ...
0
votes
1answer
15 views

Passing a nested shortcode as an argument of another shortcode?

I'm curious how to process shortcodes in arguments (not nested shortcodes, which are already contemplated):: function do_foo_shortcode($atts, $content = null) { extract(shortcode_atts(array( ...
0
votes
1answer
43 views

How to get current page title inside a page itself in a shortcode and in page content

When i add the <?php the_title(); ?> to a page template file it works and is able to pull the page title inside html tags however if i wanted to add <?php the_title(); ?> to a ...
1
vote
1answer
58 views

Audio player shortcode not showing up when using variable

I am trying to call a custom term meta field in an audio shortcode that I have placed on a custom page that I am working on. The field contains a link to a .mp3 file that I have uploaded to my media ...
0
votes
0answers
15 views

Show total number of published posts, cats,comments and views in static pages

I'm trying to show my site stats in a static page, following snippet works on page templates. I would like to know how can I turn it to a shortcode so that I can paste it into any static page e.g. in "...
0
votes
0answers
20 views

Modifying single-portfolio.php or creating shortcode to display portfolio tags

I am trying to create a shortcode that can be used to display the project attributes (Categories) of a portfolio item on the portfolio item page. I am using salient and they only allow for the ...
0
votes
1answer
21 views

the_excerpt displaying code inside style tag

I created a custom visual composer element where I included a style tag on it to use the chosen color to create hover effect. And this code is now displaying in the the_excerpt in the search result ...
0
votes
1answer
16 views

Native gallery custom html output

I've added image gallery to my page via Add Media > Create Gallery. I don’t want to output default html of the gallery, neither are sufficient options to change gallery sortcode's attributes: itemtag, ...
0
votes
1answer
31 views

Add JS in footer via shortcode?

I have created a shortcode that does some PHP processing, and then returns some javascript; current code is as follows: <?php add_shortcode( 'round_time_to_next_15_min_interval', '...
1
vote
0answers
21 views

How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]

I want to show a form at the end of my purchase-confirmation page only in the case where the previous page / HTTP_REFERER is the checkout page. I've tried lots of different ideas. For example, I was ...
0
votes
1answer
26 views

How to find specific shortcodes in a post or in a widget and pass them to a variable?

I've created a shortcode in my plugin and I used it in some pages. Now I have to get the attributes of these shortcodes on the posts that includes the shortcode. A sample shortcode is [book id="432"]....
0
votes
2answers
98 views

Convert Wordpress shortcodes into plain html

I am building a static landing page on WordPress root folder, and I need to import some shortcodes from an existing page located in wp-content directory. What I do is import with $post = get_post($...
0
votes
0answers
11 views

Adding shortcode to Master Slider

I want to add an eform shortcode in my a certain slide in Master Slider. How can I achieve this kind of stuff? Any help would be appreciated.
0
votes
3answers
36 views

Is it possible to return content, and then also continue to do other things?

Please see my shortcode script below (which is intended to print the next 15 minute time interval, eg if the current time is 9:01pm, it would print 9:15pm). I have managed to produce the correct ...
0
votes
1answer
13 views

Get all the URLs of the pages that uses a specific shortcode

For example my example.com/sample-page/ is using [my_shortcode param="1"]. How can I get all the URLs of the pages that uses [my_shortcode]? Is there an approach to achieve that?
0
votes
1answer
23 views

Function in a wordpress shortcode

from days i have a problem, sorry for my bad english. I've wordpress with buddypress + woocommerce + wc vendors pro. I need show member products list inside his buddypress profile. This list is ...
0
votes
0answers
55 views

Wordpress show descriptions under images in gallery

I’m new here. I was looking all over the Internet for a solution to show description under all images in gallery, I have found a plugin from Tom auger, but it was not compatible with wp new version... ...