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.

670 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Output Custom fields in table with Shortcode

Sory for the complete newbie question but after 2 days struggling: I have made a custom post called cars in Worpress with a plugin that adds numerous specs for cars that are for sale. The specs are ...
0
votes
0answers
47 views

Display an image using path from value set in cookie

I was wondering if anybody could help me please. I've been struggling with this for a couple of days and running out of steam. Google isn't so great now either :/ I'm trying to display an image on ...
0
votes
1answer
252 views

Custom Post type shortcodes

I create a custom post type (features) in my theme with Advanced Custom Field. I want to know how i can create a shortcodes of my custom post type. so that i just used a shortcode of that custom post ...
0
votes
1answer
369 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
1answer
86 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
1answer
63 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
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
43 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
27 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
35 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
52 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
23 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
105 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
16 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
51 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
0answers
29 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
72 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 ...
0
votes
0answers
43 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
112 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
0answers
47 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
14 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
24 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
37 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
0answers
21 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
109 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 ...
0
votes
1answer
44 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
25 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
0answers
22 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
0answers
20 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
151 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
22 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
72 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
113 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
44 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
58 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
0answers
39 views

Pass Underscore.js Variable to a Shortcode

I am using WP Store Locator to list nearby "Therapists" (therapists=custom user group with Ultimate Member, this part of the project works perfectly) and Front End Pm for a basic messaging ...
0
votes
1answer
31 views

Shortcode Attribute not defined

I have a shortcode [gf_popup pause="1000" location="bottom"] and the location attribute keeps coming back as Uncaught ReferenceError: bottom is not defined. Any thoughts on why? Here is the main ...
0
votes
1answer
26 views

Contact Form 7 shortcode is commented out, but I receive spam emails from it

I have a CF7 in one page, that actually isn’t working and I commented it out, so it does not appear on the site. But the interesting thing is that I receive spam emails from this form. Why this is ...
0
votes
0answers
22 views

Automatically add shortcodes as quicktags?

Is it possible to take all shortcodes from your site then add them as quicktags in the editor?
0
votes
0answers
17 views

Add Style to text in a PHP block

I have created a slider in header.php, which has a title and a log-in form. I would like to style the title. <div class="half"><?php echo 'Sign Up for New Membership'. do_shortcode( "[mepr-...
0
votes
0answers
19 views

Add panels with images and description in wordpress

Good day! I wanted to add a panel into my website homepage complete with panel heading and body. I also wanted to add an image inside the panel body but I have been very unsuccessful. I have been ...
0
votes
0answers
40 views

Gutenberg Block: Render Shortcode

I'm working on a WordPress plugin using cgb-scripts to create blocks. That makes development very easy, though there is hardly any dynamic blocks support. I found out, that when creating a block I ...
0
votes
0answers
17 views

How to wrap ALMOST all content in a div for all old content?

Nearly all of my posts have normal content but then ends with a shortcode. So, h2 elements and paragraphs, but then at the end of the post, the shortcode that ends up implementing a div tag with ...
0
votes
0answers
15 views

Show template notice instead of reply form when user is logged out

When using the shortcode [bbp-reply-form], how do I display a template notice in the place of the form, like “You must be logged in to reply to this topic.”, when the user is logged out? Its only ...
0
votes
1answer
91 views

Add Shortcode to ::before class

I want to add a button (that will open an INFO popup screen with info about a certain option in a woocommerce variable product), all that can be easily created with a plugin that converts the whole ...
0
votes
0answers
92 views

WP_User_Query Search Multiple Keywords from a Multi-Select Field?

My code below works to list a single user when I ask to search for a single username; however, I am unable to list multiple users when asking to search for multiple usernames. Here is a brief ...
0
votes
1answer
30 views

Shortcode not working when I output data from wpdb html table row

So I created a custom page in dashboard with a tinyMCE editor that can save html in a table row that i created in wp db. I am also able to output the html on a custom template page. However the ...
0
votes
0answers
15 views

Linking WordPress User Profiles Together With Shortcodes

I am using Ultimate Member, and have franchise owners as one user role and shops as a different role. On the franchise owner profile, I have included a shortcode (that I need help with) to display the ...
0
votes
0answers
181 views

Woocommerce “products” shortcode with “on_sale” not 100% working

I am using the following shortcode to display a paginated page with all products currently on sale on the store : [products columns="6" per_page="12" orderby="date" order="DESC" paginate="true" ...

1
4 5
6
7 8
14