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
14 views

What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post

I want to show all non-empty tags used on the site in a sidebar next to the post. Currently, inside a shortcode-triggered function in functions.php I'm calling... $tags = get_tags( array( 'orderby'...
0
votes
0answers
16 views

Using shortcodes in the Site Title

I'm using MetaBox for a settings page with custom fields. I'd love to be able to use their shortcode to pull custom fields into and used as the Site Title. Does anyone have any ideas on how this or ...
0
votes
1answer
34 views

Using ob_start and ob_get_clean with wordpress shortcode

I am including HTML template in my shortcode by using ob_start & ob_get_clean. Everything works normally but the returned HTML structure is broken. this is how I am inlcuding the html template in ...
0
votes
0answers
24 views

Returning HTML to Shortcode Block

I have spent way too much time trying to clean this up. I am simply attempting to return some HTML from a shortcode, into a shortcode block within the content editor. $next_friday = new DateTime(); $...
1
vote
1answer
20 views

Bulk converting shortcodes to blocks with embeds

Is there a way to do a mass conversion of shortcode embeds to Gutenberg block-style embeds, including converting a classic block to a Gutenberg block? I'm in the process of moving a WordPress site ...
0
votes
0answers
17 views

Create shortcode for metabox gallery

I have a metabox gallery in a custom post type. Usually I display the gallery in the front end using the following PHP code in my theme: $gallery_images_1 = get_post_meta( $post->ID, '_post-metabox-...
0
votes
0answers
12 views

Get Required Assets (JS, CSS etc) for post using REST API

I'm using the REST API to access WordPress data and publish it on a custom frontend as part of an integration. This works great because the shortcodes are parsed and rendered by WordPress so the ...
0
votes
0answers
28 views

Alike Shortcode using in Custom Shortcode

I'm using Alike plugin to compare my custom post types, Alike provides shortcode [alike_link] to run the procedure and I have created a shortcode to display my custom post type. In this shortcode I ...
0
votes
1answer
28 views

WP REST API remove the Wordpress shortcodes from the JSON wp/v2/posts content->rendered

I'm trying to get rid of the shortcodes that wordpress gives me when i use the WP REST API. I already managed to remove the HTML tags by editing the class-wp-rest-posts-controller.php by using ...
0
votes
0answers
24 views

Shortcode for Comments and Comment Boxes in Post Loop

Is it possible to get the comments and comment boxes for each post in a loop so users do not have to navigate to the actual single post page to leave a comment (and instead users can leave comments on ...
0
votes
0answers
18 views

get category in list of posts // shortcode for custom related posts

i am looking for a solution to get the category of the related post. I created a shortcode (@buttered_toast helped me, thanks for that) that can be inserted in a post. This shows custom IDs/posts. It ...
0
votes
1answer
36 views

shortcode // get posts by ids

I am looking for a solution to display custom posts in a shortcode. For one post this already works as desired, however I would like to specify multiple IDs. like: [posts id=1, 2, 3,4] Cause I come ...
0
votes
1answer
25 views

Get a Post Loop based on Logged in User information into a Shortcode

I have a follower button on users profiles where users can follow other users. I have a page template that shows all posts by users the currently logged in user follows. I would like to create a ...
0
votes
1answer
37 views

Return all Tags and Categories in Separate List

I am using the snippet below to create a shortcode to get all tags for a search in a separate list including tag count. Eg search for 'foo' and it returns all tags for all posts that match the search '...
0
votes
1answer
19 views

Wordpress basic functions show on top in custom shortcode

I created a function in my functions.php to show related posts for a custom posttype. Because the original developer used a themebuilder, I need to use a shortcode to display this function on the ...
0
votes
0answers
14 views

Display "no post" message

I am working from someone else's shortcode and not sure what I'm looking at. I need to add a custom message if no posts meet the criteria. [su_posts template="templates/default-loop.php" ...
0
votes
0answers
15 views

Show in an entry a Custom Post Type associated to a post

This is the information of my problem: Technologies used: Divi Theme - WordPress Scope: Show an Advanced Custom Field of type post_object related to a specific post. Details: I have a custom post ...
0
votes
0answers
32 views

Can I add Short Code Of A Plugin In The Code Editor of WordPress?

I'm an amateur in WordPress, so need much needed help. Can I add the short code of a plugin in the code editor of WordPress, will it work? I need to make some buttons in the frontpage log into a web3 ...
0
votes
1answer
21 views

Use atributes of shortcode in get template part

Hi guys im doing a custom shortcode where the client can set a custom taxonomy and display in my sidebar I want to use a template using the get_template_part but i dont get the terms of the taxonomy ...
0
votes
1answer
15 views

Display Visual Composer shortcode if a post belongs in specific categories

I have a PHP template file that requires some Visual Composer shortcode to be added. I only want the shortcode to display if a post belongs to certain categories. At any one time, at least three child ...
0
votes
0answers
13 views

Load templates, pass arguments, and render output from functions.php

I can't seem to find a solution to actually loading a template, passing arguments to it, executing it, and displaying the results from a shortcode registered via functions.php Is this even possible? I ...
0
votes
0answers
21 views

How convert Old Shortcode to Gutenberg block?

I have theme and plugins in website more that 70+ shortcode. Its very hard to write those code from start. Is there anyway to reuse HTML and save meta method for the same? add_shortcode('...
0
votes
1answer
15 views

WPGut - Updating failed and shortcode?

I have a problem updating the WordPress page with custom created shortcode and inserted it? Help, error status code: Updating failed. The response is not a valid JSON response. Shortcode: function ...
0
votes
0answers
25 views

Global $post returns 2 objects for my shortcode

I made a shortcode, it does most of what I need it to do. Except for a filter I need the post id of the page the shortcode is placed. (to get some linked custom field values) And I can't expect the ...
0
votes
0answers
15 views

Shortcode for multiple pages

I'm developing a plugin to show users profile list under specific role, each profile must have link for profile details page How can impletent this with the shortcode? I have noticed woocommerece ...
0
votes
0answers
22 views

Shortcode with different ids parameters

I have created a shortcode to have compatibility with id parameters, like this: [edd_user_has_purchased_contrary ids = "10"] It works fine, but when I put more id's it no longer works. I ...
0
votes
2answers
17 views

How to display html element and php string in the same line?

Hope someone can help me with this. This is my code: function swh_woocommerce_store_credit_shortcode() { $store_credits = swh_woocommerce_get_store_credits(); echo "<span style= '...
0
votes
2answers
25 views

How to Display Shortcode's Content after Short Product Description?

This is my Shortcode: [mbv name=”product-info”] And i want to display this shortcode's content after WooCommerce Short Product Description How can i do it?
0
votes
1answer
23 views

the_content getting current page content instead specified ID

I'm using below code to call the_content of a custom post type post, but when I'm run it, it always getting the current page content not the page whose ID specified. It literally duplicate my page ...
0
votes
2answers
34 views

Echo Extra Shortcode HTML to wp_foot

I'm making a button shortcode that requires to attach extra HTML element to wp_foot for each shortcode added. function action_button_shortcode( $atts, $content = null ) { extract( shortcode_atts( ...
0
votes
2answers
39 views

How to add if statement on WordPress shortcode output

I'm making a shortcode function that collects data from WordPress media library function byn_recent_resources_shortcode($atts, $content = null) { global $post; extract(shortcode_atts(array( ...
0
votes
0answers
24 views

wp_mail email sends twice

I created a button on a User's page. It sends an alert email to the admin. It was sending the same email to me 5 times... but I have made some changes. Now it is sending the same email twice. I have ...
0
votes
0answers
31 views

How can I use a plugin shortcode inside of a html form?

I'm using the Simple Wordpress membership plugin for page access. There is a shortcode that can be used to display the username once logged in. I have a form that submits a mysql query and creates ...
0
votes
0answers
22 views

Shortcode in Shortcode/HTML Graphics and Pictures

I got some problem regarding a shortcode in another shortcode. Here the whole PHP code snippet for the Outer shortcode: function shortStat($atts, $content = NULL){ if(isset($_POST['...
0
votes
2answers
107 views

Custom shortcode works in Elementor editor but not on frontend

I'm used to creating custom shortcodes through my child theme and Elementor, never a problem. However this time something is wrong, when I inserted the shortcode widget in Elementor editor my code is ...
0
votes
0answers
20 views

WPBakery Blog Excerpt showing code

WPBakery Blog is pulling through code like: [vc_row][vc_column][vc_column_text]This is my blog[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/2"] I have selected excerpts ...
0
votes
0answers
30 views

Thumbnail image doesn't show up in Shortcode output

A 'WordPress Shortcode' is being developed to display 'YouTube Channel Thumbnail' and 'Latest Playlist Thumbnail' when supplied with 'YouTube Channel ID' as follows. [yt_insert channel_id="...
0
votes
1answer
8 views

Why is the current page loaded in the pop-up window and not the specified one?

I made a shortcode which I put in the popup. The shortcode just needs to get the content of the page by ID I created in Elementor and show it in a popup with the same design as it is on the inner page....
1
vote
0answers
26 views

WordPress function not being called from jQuery method

I’m very new to WordPress Plugin Development. I’ve been learning and developing my plugin for around 2 weeks now. My plugin is supposed to be a retrieve a question from the WordPress database and ...
0
votes
0answers
17 views

how to add shortcode in plugin and use this plugin

I have a website and I wanted to implement Face ID when registering. I found the Face Recognation plugin functionality to fit perfectly. Only I need this plugin to work on the frontend during ...
0
votes
0answers
20 views

Gutenberg Shortcode Chooser Block

Basically, i want to create a block that shows a popup with the list of my custom post type shortcodes then there should be a link against each shortcode for insertion. Please see attached image of ...
0
votes
1answer
18 views

shortcode executed in the page editor

I am trying to create a really simple plugin that creates a really simple shortcode, but when I insert the shortcode in the editor, and try to save the page I get the following error: "Updating ...
1
vote
2answers
35 views

Get value from shortcode to do something

For a project I want to use advanced shortcodes. Normally I define shortcodes within my PHP. This way it is always the information I have in my PHP-files that I show with my shortcodes (like [...
0
votes
2answers
26 views

Passing function arguments via a shortcode

I have a simple WP_Query that displays posts: <?php function vertical_posts( $title, $category, $num_of_posts ) { ?> <section class="vertical-posts"> <h2 class=&...
0
votes
0answers
59 views

is it possible for a URL to filter by tag

so I have put together a function that filters products by a specific tag and displays their categories. What i want to do, is extend it further so that when the customer clicks the category link ( ...
0
votes
0answers
21 views

Slider shortcode that will write an init script for each shortcode instance in WP Footer

I've been frankensteining this plugin (first time digging into plugins) using examples from Google, but I'm not well versed in PHP. The goal is to generate the init script for swiper.js for each ...
0
votes
2answers
34 views

How to search order using database frontend short code WordPress

I do not have a lot of coding knowledge. How do I add a WordPress searching database shortcode to the frontend using the metavalue as if I were to search for "demo", the metavalue(named as ...
0
votes
0answers
15 views

Custom page with shortcode function

Is there a way I can show just the name and profile picture of logged in user on a page in frontend with shortcode. I tried checking through some solutions but does not provide what I need.
0
votes
0answers
16 views

Shortcode letting user to "join" the multiple user roles

It is possible to create some sort of shortcode which allows users to "join" the particular user role from frontend? Like if user is subscriber by default to let him join also user role such ...
0
votes
1answer
37 views

pass complex json as shortcode parameter

I need to pass complex json with nested array of object as shortcode parameter. For example I need to pass something like this: { "a":"va", "b":{ "b1&...

1
2 3 4 5
53