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.

643 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

Shortcode, vs blocks, vs templates - what would you do for choosing or creating custom post data in editor?

Say you have some custom post type. Call it my_type. Now say in Gutenberg, you want to either a. Insert some data into a my_type post from an existing instance of another_type where the inserted ...
0
votes
0answers
10 views

Fixed issue removing code shorts in plugin

Hello we have a plugin whose dashboard has the settings tab and we make and code shorts but after the shorts the codes all look alike and corrupt
0
votes
1answer
14 views

save short-code in my custom plugin settings problem missed something

i want to have dynamic shortcode to CF7 when i create new Contact form the id is different from develop env to production i decide to put my shortcodes in my plugin settings. and use them as ...
0
votes
1answer
29 views

How to use code in an editor block?

I am trying to execute code in a block such that I can display the title and description of a forum topic. I noticed that the Custom HTML block doesn't seem to allow me to execute PHP. What is the ...
0
votes
0answers
24 views

Passing shortcode attributes to wp_remote_post request

I'm trying to pass shortcode attribute values directly into my url for a WordPress Remote Post request. Below is my code example below. I am using the following shortcode in my wordpress page [...
0
votes
0answers
29 views

find and replace shortcode sql database

I've been trying to replace this shortcode [RICH_REVIEWS_SHOW category=”all” num=”6″] with this shortcode [site_reviews summary count="3" hide="date"] but I'm failing miserably. I've used this ...
0
votes
1answer
58 views

Why can't I filter my CPT shortcode by category?

I've created my own Custom Post Type called 'products'. I have also registered by own custom taxonomies for the CPT - a custom category type (so it is separate from the default wp posts) and also its ...
0
votes
1answer
63 views

Place a URL parameter value inside a Wordpress short code

I would like to retrieve a URL parameter value and place it inside a shortcode so that so that it is handled as a variable, eg, http://example.com/?source=http://example.com/media/myfile.pdf ...
0
votes
1answer
71 views

Shortcode content is not showing. Only the [shortcode-tag] is showing

I am creating a small plugin where I am creating a few shortcodes. I am using Classic Editor plugin. Here is my code in Plugin.php: <?php /** * Plugin Name: Simple Data Visualizer * Description:...
0
votes
0answers
26 views

Passing User ID in shortcode attribute and use it to delete this user by showing a html button on the frontend?

I want to pass in a User ID via shortcode attributes and show a button on frontend to delete this account, here is what I have done but since I'm new to php and never made a plugin myself it's hard ...
0
votes
0answers
22 views

May an attribute have no value?

Is it allowed to add an attribute to a shortcode without giving it a value? something like: [shortcode attr1="hasvalue" attr2] The attribute attr1 has a value, which I can easily catch in a function ...
0
votes
1answer
28 views

From CPT Custom Loop into Shortcode?

Let me first start with; I'm far from a programmer, but I'm getting into it a bit. Currently I managed to make this loop for a CPT called 'studentensteden'. Now I would love to make it into a ...
0
votes
0answers
9 views

Link Change Dynamicly

I have embed an iframe in my website. I want to change the source code dynamically. Which way and how I do this. Should I use shortcode for this?
0
votes
1answer
39 views

Shortcode PHP file for two conditions passed when do shortcode

I've created a shortcode for PHP file plugin template, now the template has two HTML design one with icons displayed and another shows only the Name. Is it possible to trigger a bool when ...
0
votes
0answers
30 views

how to display display category name once

I am creating a shortcode to display the post category once and then all posts, but since I am using a foreach loop, I am not able to display category name once. I want to display category name once ...
0
votes
0answers
28 views

How to create custom wordpress shortcode for if statements

I want to be able to add shortcodes into the wysiwyg editor which will act as if statements based on the value of variables that are posted to the page for example [if q3=='fire'] <p>blah blah ...
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
46 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
183 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
288 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
63 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
53 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
42 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
33 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
44 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
22 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
87 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
26 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
67 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
72 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
41 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
36 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
75 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
43 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
23 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
21 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
102 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
20 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
63 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
88 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 ...

1
3 4
5
6 7
13