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

Slider Revolution - Uncaught ReferenceError: setREVStartSize is not defined

I am working on WordPress 5.2.2 running php 5.6.30. I was using slider revolution 5.4.8 previously which was being displayed via the shortcode however the Animations were not working I did try several ...
0
votes
0answers
9 views

How Would I add WooCommerce Brands plugin to filter with Woo search filter plugin? [on hold]

How Would I add WooCommerce Brands plugin to filter with Woo search filter plugin? Trying to get the brands to be a multiple filtered option but so far all I’ve figured out is the short code to get it ...
0
votes
0answers
11 views

Shortcode conflicts

My plugin provide shortcodes like this: [cfgeo return="city"] - returns city name [cfgeo include="us"]Text only seen in the US country[/cfgeo] - returns this text only from the visitors in the US. ...
0
votes
0answers
8 views

How to keep the selected language when changing the menu bar or page Polylang code snippet [on hold]

I have an issue with Polylang plugin. When i am at home page i choose the language( example English) which it does translate it but when i go to the other menu bar (example Contact or About Us) it ...
0
votes
0answers
14 views

Checkbox boolean always returning false in WPBakery [on hold]

I've created a custom element for the WPBakery plugin. I have mapped out a simple checkbox for this element: array( 'type' => 'checkbox', 'heading' => esc_html__( 'Add box shadow?', '...
-2
votes
1answer
26 views

Creating a shortcode with a variable (Woocommerce)?

I'm new to PHP. I want to create a shortcode that outputs a user's order number, but I'm having trouble. All I know is that the order ID variable is "$order->get_id();"
0
votes
1answer
20 views

How to pass multiple custom fields as shortcode's parameters

I'm learning how to pass parameters in shorcode, I know the basic step after read through WP Codex. But for now, I have plugin come with custom fields and as the title, I want to know how to do it. ...
0
votes
0answers
20 views

wp.blocks.registerBlockType not showing what I want on the frontend

According to my understanding, whatever is displayed in the save: function is what is shown on the page in the front end? So I am trying to query the database from my block to get information I am ...
0
votes
0answers
18 views

How to Convert Shortcode to Static content?

Shortcodes are executed dynamically, but that makes the search not work within the shortcode content. I have also tried relevanssi search. Now I would like to convert that shortcode dynamic content ...
0
votes
0answers
10 views

Controlling site wide modules from one place in the backend

I'm building pages using the WPBakery plugin. I've created custom elements for all of the building blocks, but there are two elements which appear across all pages, those being: Get in touch banner ...
0
votes
0answers
38 views

Displaying a Category on a Wordpress Page

I have a game.php file and all main categories are displayed there with a shortcode. output results by category. Question. You don’t need to output in category.php so that I don’t throw it on category....
0
votes
0answers
19 views

Multiple Video Shortcode in tabs show One video in all places

I have multiple tabs on a single page. In those tabs I have added different videos and saved them. When I go to the front side, only one video is showing in all tabs: the first one. [video width="...
0
votes
0answers
20 views

Custom post type shortcode with taxonomy attribute not working and no errors

I have the following code to display posts with a custom taxonomy but it's not working. It just displays all the posts: // Add Shortcode function custom_shortcode( $atts ) { $atts = ...
0
votes
1answer
26 views

How do you stop a shortcode from firing in the editor?

I created a custom short code that includes creating an on page table along with a few other things. But the short code is loading in the editor as well, and it is causing errors and preventing me ...
0
votes
0answers
17 views

How to display a post(by id) along with css in a page?

I am curious if it's possible to get a post content along with its CSS (say if button background color is green on the post) and display it a page? I am able to get the content but the CSS are not ...
0
votes
0answers
27 views

Show number of products in page - WooCommerce

I'm trying to accomplish the following scenario: Show the number of products based on category and when applying filters then dynamically change the count of products on that page. I'm using the ...
0
votes
0answers
15 views

How to find out shortcodes code in a page set in custom layout page template?

I tried to migrate a website to another hosting. The site is use videotouch theme. The front page is a page which is setup with shortcode plugin for custom layout with template. Because of category ...
0
votes
0answers
41 views

Shortcode to output category description by passing ID

I have this shortcode function: function category_description_output($atts) { $atts = shortcode_atts( array( 'catID' => '16' ), $atts, 'categorydescription' ); return ...
0
votes
1answer
23 views

Do I need to escape number in this shortcode function?

This is the function: function shortcode_output($atts) { return do_shortcode('[ks_tab col="'.$atts['num'].'"][/ks_tab]'); } add_shortcode( 'my_shortcode', 'shortcode_output'); People would add a ...
0
votes
0answers
23 views

How to wrap pattern-matches from the_content in [wiki]-shortcode tags

I'm working on a function to wrap word-matches* in [wiki]-shortcode tags. I suspect the best method is to use add_filter() on the_content, and parse using RegEx in preg_replace_callback_array(), but ...
0
votes
0answers
18 views

How to use products shortcode in taxonomy-product_cat with multiple columns?

I have a custom taxonomy-product_cat file and need to show some products by shortcode. but it show products just in one column!!! I tried many product shortcode but same results! $sc="[products ...
-1
votes
1answer
22 views

Shortcode Attributes - post__not_in array

I'm trying to put together a shortcode that let's the user loop posts but exclude specific ones by id. $atts = array_change_key_case((array)$atts, CASE_LOWER); // override default attributes ...
0
votes
0answers
34 views

Using <!--nextpage--> within a shortcode

Here's one issue I am currently trying to solve and it concerns using <!--nextpage--> within a shortcode. I'm developing a plugin using a shortcode (unfortunately I don't have any URL to share ...
0
votes
0answers
38 views

Why isn't working WooCommerce session inside shortcode?

Hope you're doing great! I am trying to print the WC()->session->get inside a shortcode but getting error , bellow is my code and error function set_session(){ global $woocommerce; WC()->...
0
votes
1answer
17 views

add_shortcode is not working in plugin where others are working

I have the following really simple code: function load_peoplesoft_results() { global $wpdb; echo "<h2>Results</h2>"; } add_shortcode('load_peoplesoft_result_page', '...
0
votes
0answers
19 views

Escape special characters in shortcode

I need to use Iframe fuction in wordpress tab widget. I want to put iframe src code in it < iframe src="http://externalpage/"> My external page is this one..(it has short codes in it) https://...
0
votes
0answers
11 views

Output not generating when form submitted, form generated via shortcode plugin

Consider, a bespoke short code function is created and shortcode hook is is specified... the shortcode inserts a form into the page... it checks if $_GET is set and if a hidden field has been ...
0
votes
2answers
20 views

How to set up posts per page on WP

I add this code on my website [display-posts image_size="thumbnail" wrapper="div" wrapper_class="display-posts-listing grid" meta_key="_thumbnail_id" display-post category="<code>...
0
votes
0answers
28 views

How to get shortcode attributes in react

Hey I am trying to get shortcode attributes in a react function. In php getting this data was straightforward enough, but with javascript I do not know where to do this, or what code to use to ...
0
votes
1answer
48 views

Gutenberg Shortcode Fail

WP 5.2.2 Is it possible to render a shortcode outside of the gutenberg shortcode block? I created a shortcode and have been using it on a couple of pages for years. It works great on those pages... ...
0
votes
0answers
16 views

WooCommerce; How to dynamically feed post title into shortcode attribute value?

Hoping someone could help me quickly. I want to embed a post/page title in WooCommerce's shortcode for tags so it can dynamically feed matching products onto the page: [products tag="post or page ...
0
votes
0answers
14 views

Custom shortcode sorted by meta date shows only current year and displays other language in date

I have this snippet in my functions.php. I thought it worked, but I noticed that it shows events only from this year (I have more events that are next year) and also, I can't get the date format to ...
0
votes
1answer
38 views

Shortcode and get_template_part

I'm developing my own plugin for my wordpress. I create a shortcode for my plugin and CPT with a custom taxonomy and custom single-CPT. When I try to use the function get_template_part() in my ...
1
vote
0answers
23 views

AJAX and Shortcode with Parameters

I'm creating an ajax function which will display a filtered post. I used a shortcode to display the post. The shortcode has a parameter to filter its display. I have a category and a tag parameter. ...
0
votes
1answer
30 views

How to create custom variables in wordpress

I made a wordpress faucet site using some plugins, and I would like to make it a little better. I would like to make a referral link, so when it is http://free-liteco.in/?r=Your-Address, I would like ...
0
votes
0answers
16 views

Change Text font color in swift framework, in coundown or counters shortcode

my background is black, the shortcode gives the option to change the title color, but the numbers still stay black. That results with black font on black background. I'm using Dante template, here is ...
0
votes
1answer
36 views

get_posts() from parent category only using a shortcode

I am trying to get_posts() from a category that has a subcategory within. To show an example please look at the image just below. So, as you can see. The parent and the children have posts inside. I ...
0
votes
0answers
19 views

Wordpress menu hides when i add custom shortcode

I built a plugin that generates a fullpage tab after a shortcode is called but for some reason immediately the shortcode is called the main menu hides on the page. My custom css is shown below ...
0
votes
1answer
46 views

Help using ShortCodes to style whole chunks of the post

Recently my sites got hacked, forcing me to start rebuilding them from scratch. It's been ages since I spent time on them, so I don't even remember the plugins I'd installed and used. One of them, ...
0
votes
0answers
18 views

slider disappeared after installed a new plugin

i have a WordPress woo-commerce multi vendor website here i'm used dokan plugin recently i worked to add some future to my website i installed t-shirt eCommerce plugin and setup a new page with that ...
0
votes
1answer
28 views

ACF get_field() is not returning a value in WordPress

I am using ACF and CPT cooperatively. I created a shortcode to be placed in a text module in my theme. It works well. Yet, when I call ACF get_field(), it's not returning any value. I tried looking ...
0
votes
0answers
9 views

restrict userlevel=“subscriber” content showing when item is searched

restrict userlevel="subscriber" content shows when you search a product regardless if the person is logged in or not. The restrict works when the product is viewed normally but shows up when using the ...
0
votes
0answers
24 views

add shortcode to custom post type list

im trying to generate a shortcode for every custom post type object i create and show that shortcode in the list of my posts. Elementor does this in its templates post type. How can i manually add ...
0
votes
1answer
26 views

Logout user if click on a custom page link

I want to logout a user if the user click on custom page link (e.g. example.com/logout). I need to do that because my site users are not allowed to access wp-login.php page. I've a front-end login ...
0
votes
0answers
14 views

Run PHP on Gutenberg blocks of Twenty Nineteen theme

I'm trying to use Twenty Nineteen to reproduce my website, using a more up to date theme and taking advantage of Gutenberg blocks philosophy. In my original website I have used many of <div></...
0
votes
1answer
102 views

Display shortcode based on user meta

I have been working on a project where I want to display a shortcode based on the user meta data. I have added a user meta while creating a new user. The default value of the user meta is set to false....
-1
votes
1answer
20 views

How to create a shortcode with HTML code in it and custom parameters/

I want to create a shortcode for putting newsletter opt-in boxes in my posts and pages. But depending on the page or post, I want to have different headline and description for the opt-in box. I ...
0
votes
1answer
15 views

Shortcode runs when editing page

I have a page which only contains this: [memberdirectory] [/memberdirectory] It's purpose is to list names and addressed of members. It loads and runs the associated function without any problem. My ...
0
votes
1answer
32 views

Regenerating Wordpress shortcodes based on <select> value with AJAX

I'm trying to generate & replace Wordpress shortcodes with AJAX based on the user's chosen <select> option. I've posted my progress to date below - whilst the shortcodes are currently being ...
0
votes
1answer
22 views

Shortcode to show current post category with link

I want to display the current post category with link using shortcode [post_category]. The current code I got below shows the current category as text. I want it to be a link to the category. Thanks. ...