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

Wordpress shortcode for contact form 7 does not work [on hold]

I'm trying to add a function shortcode for wordpress contact form 7 to obtained information by $_POST but it is not working only appear the tag [cs7] , what could be happening? Does anyone know how ...
1
vote
0answers
10 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
18 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
12 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
0answers
14 views

How to pass input field value as shortcode function value?

I have the TasteDive plugin installed, which enables this simple shortcode format: [tastedive search="VALUE"] for example [tastedive search="Breaking Bad"] On my website I would like 2 pages: - Page ...
0
votes
0answers
8 views

wow i can nest a caldera forms magic tag shortcode with another plugin?

I have a caldera forms form plugin, this plugin support a functionality called magic tag.Magic tags working as a shortcode, replacing the value according the slug of field. For example:form field with ...
0
votes
1answer
32 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
26 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
12 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
8 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
13 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
26 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
19 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
45 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
9 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
34 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
12 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
19 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
43 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... ...
-1
votes
2answers
17 views

Enclose article's body with default shortcode

I'd like to enable this plugin https://responsivevoice.com/wordpress-text-to-speech-plugin/ as default for every article's body in my wordpress site. I need to edit my article template and the final ...
-1
votes
1answer
16 views

foreach return displays double results

Seems I have a little bug in my WP code. When I add the shortcode to my page, it displays the results twice. If I use echo this will post at the top of the page, I want to enable to shortcode so it ...
2
votes
1answer
21 views

Wordpress auto adds p to shortcode parameters

Wordpress auto adds p tags around shortcode parameters. Is there any way to stop this ? function minimum_working_example ( $atts, $content ){ extract(shortcode_atts(array( 'html' => '',...
0
votes
1answer
15 views

How to strip header tags & shortcodes from the_excerpt()

I'm trying to learn how to strip "header tags" & "shortcodes" from the_excerpt()... Searched for an answer to no avail so thought Id ask the community. Thanks for your time Best Shaun
0
votes
0answers
20 views

Create WordPress shortcode from database entries

So I want to create a shortcode for every row in my database. The problem here is that the add_shortcode() requires a shortcode, which I can create a variable for in a foreach loop and a callback ...
-1
votes
1answer
20 views

How to write a query-function as a query-shortcode?

I ask this question as a follow-up to this one. I have this query-function in functions.php but AAMOF I don't want to change functions.php at all (besides for CPTs). I'd like to print the same data ...
-2
votes
1answer
21 views

Creating mixture of shortcodes to use in the visual/text editor

I am attempting to make a page on my site that has a mixture of different kinds of content. So I'd like for the first part to just be the_content, but then beneath it calls to posts under specific ...
0
votes
0answers
27 views

Avoiding do_shortcode() loops

I have a situation with a custom theme I'm developing that creates custom widgets made to accept shortcode. Issues arise though when that shortcode evokes shortcode of its own. The potential arises ...
-1
votes
1answer
54 views

Integrate Razorpay quick payments plugin with contact form7 plugin

I'm using a Contact form7 and Razorpay quick checkout plugin in WordPress. The shortcode for it is [RZP]. Help me use this in contact form7. What I have tried is in the functions.php of contact-form-...
0
votes
1answer
23 views

shortcode display metainformation as linked image

I am trying to make this shortcode to display a self made meta field called qrbase_code_pass_url as a linked image. The image should be static, but should get the dynamic URL from the meta field of ...
0
votes
1answer
23 views

Error: The Content Area Was Not Found in Your Page

My site is running Generate Press theme and using Elementor as page builder. My goal is to created a shortcode that will display a CPT and it's metafields. When i use the shortcode on a page it works ...
3
votes
2answers
113 views

Shortcode attribute value with dash (hyphen)

Is it safe to use hyphen in shortcode attribute value? For example: [foo something="fo-bar"]
6
votes
2answers
45 views

How do I create a Shortcode that returns text if domain is .com, not .co.uk

I am trying to create a shortcode to see if the url matches with the attribute, then return the content. So far I have: add_shortcode( 'ifurl', 'ifurl' ); function ifurl( $atts, $content = null ) { ...
1
vote
0answers
34 views

Shortcode function executed twice?

I use a shortcode function to do some processing as a callback from external service. I created a page, the only content of which is the shortcode. User is redirected to this page from external ...
2
votes
1answer
34 views

Pass shortcode variables to template

What I want to achieve I have a custom page template, and I'd like to display some selected Posts on that Page. I'm developing this feature with shortcode. For now, I only need to receive the post ...
2
votes
1answer
23 views

Can't get JS code to work with shortcode

I am trying to create a plugin and I've got stuck. I am trying to register and enqueue a script from a shortcode: This is my shortcode: add_shortcode( 'gear-guide', 'gg_product_front_end' ); This ...
0
votes
1answer
151 views

How to seperate posts by categories?

I have CPT called "investment" and I want to display all the posts in that CPT by it's category. I'm doing that via shortcode. e.g. [myshortcode type_of_post="investment" cat="12,30"] and I want it ...
0
votes
1answer
25 views

create a shortcode for embedding google map in a page

I'm trying to create a shortcode that lets you embed google map anywhere in wordpress page. shortcode must be able to pass two attributes ( latitude and longitude ) Below is edited question ( I did ...
1
vote
2answers
41 views

Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes

I have 2 custom post types, project and person. Both have several custom fields. I'm working on a template for the project custom post type. In the project custom fields I have several fields of type ...
1
vote
1answer
50 views

wc_get_product in a none woocommerce page

I am creating a new shortcode in which I want to show some details about a product in a review-like page. If I got it right - I can only use wc_get_product if the current page is using the ...
-1
votes
1answer
32 views

How create a shortcode with html

I want to create a shortcode for following HTML content: i want print different alert or messages using that HTML code <div class="notify"><span class="symbol icon-fact"></span> &...
0
votes
0answers
20 views

Shortcode's output to use as other shortcode's parameter

I'm trying to pass Shortcode A's output as a parameter to shortcode B [su_post field="post_date_gmt"post_id="173" filter=""] // Output 2018-07-22 12:06:35 [transform_date date='2018-07-22 12:06:35'] /...
0
votes
1answer
39 views

My shortcode does not call the function

I'm trying to make a shortcode with two parameters $number_posts and $category_name. The shortcode is calling another function named bg_make_post_grid that uses those parameters as variables. I ...
1
vote
1answer
31 views

Duplicating Table of Contents for Paginated Post

I have a technical blog with very long posts. I'm using pagination (via <!--nextpage-->) to separate the content into multiple pages. I manually add an html table of contents (TOC) on the top of ...
1
vote
0answers
29 views

Shortcode Plugin to dynamically build a shortcode via `do_shortcode` not working

Basically I want to create a plugin that provides a shortcode for use anywhere. This plugin will query the user's preferences and render another shortcode/plugin with proper settings (to cater ...
0
votes
0answers
12 views

split content around a shortcode in a custom wp_editor

so here goes. I am developing a custom content manager for WordPress. with this I have created a Block Manager, you add a block, you pick container size, background colour and so on. One of the ...
0
votes
1answer
24 views

Add audio file to post using custom term meta field as link [closed]

I am trying to add an audio file to my custom post type using a custom term meta field as a link, but I can't get it right. Here is how I would normally display a custom term meta field: <?php $...
1
vote
1answer
19 views

Undefined index: sui_image_caption in [closed]

I am getting this error: Notice: Undefined index: sui_image_caption in /home/xxxxx/public_html/xxxxx.com/wp-content/plugins/source/submit_user_images.php on line 73 Notice: Undefined index: ...
1
vote
0answers
24 views

add_shortcode to capture URL screenshot not loading correctly

Hello I have a function as shown below to capture website screenshot, as well to be used as a shortcode in a text widget. The shortcode [metadata_website] is somewhat working, the issue i am ...