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.

641 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
84 views

Help create a shortcode to filter displayed content

Can you please help me create a shortcode to filter the display of another shortcode inside it based on a value inside the user profile? Im combining the user of two plugins here, ultimate member and ...
0
votes
1answer
64 views

Trying to Understand Shortcodes.

am completely stumped on this for some reason. I have block of code that I had in my header.php <?php if ( is_page("Home") ) { if( have_rows('slider') ): ?> <div class="my-slider">...
0
votes
1answer
30 views

How wp maps urls into files

I am trying to understand how wordpress works. I have found this line of code in my theme: <?php echo get_permalink(get_option('Theme_search_page_id')) ?> If I get the that option from mysql I ...
-1
votes
0answers
8 views

Wordpress & Elementor Content Locker problem

So, I want to add a content locker for a post to capture more e-mails. The issue is, I am using Elementor and once I add it, the content locker applies only to the block I added it to. How do I make ...
-1
votes
0answers
24 views

able to login wp-admin for the put the vat tax

function wc_tax_exempt_unlogged() { // Getting user data for logged users if( is_user_logged_in() ){ $current_user = wp_get_current_user(); $current_user_id = $current_user-&...
-1
votes
0answers
10 views

Woo commerce single product - Multiple featured image thumbnails

I've been trying to find a solution to this for a while now. I added single product page in two different categories and my question is: can I change the thumbnail to show different image under ...
-1
votes
1answer
20 views

What does this shortcode do?

function my_shortcode($atts, $content = null){ extract(shortcode_atts(array("type" => "warrning"), $atts)); return ".$content."; } add_shortcode("warrning_dialog", "my_shortcode"); I know ...
-1
votes
1answer
60 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 ...
-1
votes
1answer
45 views

IFrame Shortcode plugin - issue

[iframe src="https://www.quora.com/" data-no-lazy="1"] Hey guys I'm trying to add external webpage to wordpress. I'm using "Flyn San" plugin for that but its not working properly. I have attached the ...
-1
votes
1answer
27 views

related articles using shortcodes

I want to make related articles based on the categories in the sidebar using shortcodes so that they can be placed anywhere. can you help me? thanks before.
-1
votes
1answer
20 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 ...
-1
votes
1answer
25 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 ...
-1
votes
1answer
849 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-...
-1
votes
1answer
606 views

If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?

When using YITH to display the wishlist in the my-account endpoint of WooCommerce, the wishlist works fine, but the endpoints stop working. If we change the page to anything else other than the my-...
-1
votes
1answer
48 views

Add widget/shortcode to sidebar OUTSIDE of the theme

I have a theme that shows a boxed layout. Meaning that on the left and right side there is space where no widget can be placed. I'd like to add advertisement there through a plugin, for this I need to ...
-1
votes
1answer
83 views

A next page function with shortcode?

I'm trying to create a next page function in php that's also a shortcode. The code creates a next page link. But the link appears above all the content (instead of where I put the shortcode), and ...
-1
votes
1answer
1k views

Shortcode to include PHP file, pass various parameters to include?

Want to include php file in WP content. Some parameters will be different depending on the include. I want to write 1 include shortcode. I do not want to write different include functions for each ...
-1
votes
1answer
18 views

Shortcode Site include in a other

I would like to use the Shortcode Plugin but I don't know which file I have to put it. Please provide me, that I can use the nice Plugin.
-1
votes
1answer
4k views

Sorting Woocommerce products by category and attributes

I've been trying to get this code to work without having to modify the core woocommerce shortcode file, to no avail. It works when entered into /wp-content/plugins/woocommerce/classes/class-wc-...
-1
votes
1answer
10k views

How to call shortcode on button click

i want to call a shortcode on button / link <a href="<?php echo do_shortcode( '[wizard id=1]' ); ?>" class="btn" > CLICK TO OPEN SHORTCODE</a> but it's not working.
-1
votes
1answer
1k views

Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode

I'm using Toolset Views to display a list of taxonomies. These taxonomies are under a custom Taxonomy that I created with Toolset Taxonomies. I then used the plugin Taxonomy Images to add the option ...
-1
votes
2answers
686 views

shortcode doesn't work

I made my first WP plugin, it is a contact form - here is the code: <?php /* Plugin Name: Example Contact Form Plugin Plugin URI: http://example.com Description: Simple non-bloated WordPress ...
-1
votes
1answer
953 views

How to show in front End images using Visual Composer attach_images?

$gallery = shortcode_atts( array( 'post_gallery' => 'Gallery', ), $atts ); $img = wp_get_attachment_image_src($gallery["post_gallery"], "large"); $output = "{$img[3]}"; I can'...
-1
votes
1answer
38 views

Display function from functions.php in tag.php

I've added several functions to the functions.php file. I call those functions using a shortcode [shortCode] while in posts, pages, and widgets. But the [shortcode] will not work outside of posts, ...
-1
votes
1answer
127 views

Add the results of a custom query into a do_shortcode

I'm trying to add the post list from a custom query while ( $the_query->have_posts()) : $the_query->the_post(); into the content of a do_shortcode. How can I do this?
-1
votes
1answer
939 views

Why is my ajax live search not working when i use a shortcode to call it?

I've finally managed to get my live search in Wordpress working, but it only works when i directly call it in the class. I want to put it in a shortcode, so i can call it on every page i want. But ...
-1
votes
1answer
709 views

Wpautop stops working after get_the_excerpt

function pre_process_shortcode($content){ global $shortcode_tags, $shortcodes; // Backup current registered shortcodes and clear them all out $orig_shortcode_tags =...
-1
votes
1answer
517 views

Display HTML5 jQuery Audio Player On Front Page

I would like to display the plugin HTML5 jQuery Audio Player 'centered' on the front page of my site. The plugin comes with shortcodes for posts and pages but my front(home page) only works with the '...
-1
votes
1answer
132 views

Shortcode in a page to display custom posts which also have a shortcode in them

I have created a shortcode [get_custom_posts] to be inserted in a page (the default page post type from WordPress) to get posts which are from a custom post type. In each post from that custom post ...
-1
votes
1answer
163 views

Shortcode not picking up custom field

I created a custom field that allows me to set the cropping style of timthumb, but I am also using short code to populate a page with blog posts, but the shortcode isn't picking up the customfield, so ...
-1
votes
3answers
1k views

Using $variable in shortcode

I will use an $variable who is outside the function. In the shortcode function. This is what i will do: function shortcodevariable( $atts ){ return 'echo $variable'; } add_shortcode('variable', '...
-1
votes
1answer
201 views

How to loop through a custom post type using a shortcode and output each element in the loop using shortcodes

I have a php function which loops through a custom post type and outputs a number of different elements. For example: an opening li tag an img tag an opening div tag a title a description a button ...
-1
votes
1answer
3k views

using a shortcode in a hyperlink

I am trying to use a shortcode inside of a hyperlink <a class="wpb_button_a" title="Reserve Now" href="/reservation/?unitrate=[print_csv position="5"]&amp;unitsize=5%20X%205&amp;...
-1
votes
1answer
916 views

Shortcode for Visual Composer Grid fails turning string to integer

I am working in a shortcode for visual composer grid. I want to show the list of terms of a taxonomy (portfolio_tag) associated to a custom post type (portfolio). The shortcode gets the ID from the ...
-1
votes
4answers
2k views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( '...
-1
votes
1answer
47 views

Shortcode returning specific content of a post

I'm currently building a plugin to display specific part of post after accepting verification code. Can a shortcode return a part of a post? I mean: Bla bla bla [shortcode postID="100"] Special bla ...
-2
votes
1answer
39 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();"
-2
votes
1answer
27 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 ...
-2
votes
1answer
36 views

create shortcodes for posts

$query = new WP_Query(array( 'post_type' => 'my_posttype', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' )); while ($query->have_posts())...
-2
votes
1answer
221 views

Can I prevent wordpress adding <p> and <br> tags to autoembeds

Cant give a reduced code example right not because my Advanced Responsive Video Embedder plugin is somewhat complicated. But the exact same code is used to generate the embeds, its just through ...
-3
votes
0answers
20 views

Edit a shortcode with another shortcode

Please Help me I have 2 shortcode in Wordpress from 2 plugin. First shortcode is [cmc-coin-name type="symbol"] and second shortcode is [cryptocurrency_widget type="card" template="chart5" color="...

1
9 10 11 12
13