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.

learn more… | top users | synonyms (2)

0
votes
1answer
17 views

Shortcode tags appear on mobile themes

I want to use a mobile theme plugin for mobile formats. I tested five different mobile plugins and they all display my shortcode tags upon rendering on a mobile device. The user will see the ...
0
votes
1answer
63 views

Create dynamic content from one WP page to multiple other pages

I want to create dynamic content that is taken from a specific paragraph from one page and writes to a paragraph on multiple pages that feature that same content. I am new to PHP and not sure how to ...
0
votes
1answer
22 views

How to show the view more on my display of pages shortcode

I want to show the list of childpages under a certain parent page & set how many childpages to display & show the "View More" link below the last child page displaying. What was missing from ...
0
votes
1answer
42 views

How to echo an array returned by a function

I am trying to display a list of items retuned by an array by using do_shortcode(). The problem is I have to use echo statement with do_shortcode and in my function I have to a foreach loop which ...
0
votes
1answer
38 views

Easy way to show excerpts of specific posts on a page

Suppose I have 3 posts on my wordpress site titled: Test_post_1 with tag test_tag Test_post_2 with no tag Test_post_3 with tag test_tag Suppose now that I have one page titled page_1. On that page ...
0
votes
0answers
22 views

How to display the 3rd & 4th level children only, using get_children()?

I found this code & edited it for my needs. How can I only display the 3rd & 4th level child pages of "Home"? I just want to display the 3rd & 4th level child pages because that's the main ...
0
votes
0answers
15 views

TinyMCE Custom Styles or Shortcode Components?

One of the WordPress theme projects I'm working on for a hiking and travel blog adds additional facts and notes in small info boxes about the particular topic being discussed. For instance, on a post ...
0
votes
0answers
26 views

Shortcodes on instagram

I want to embed my instagram picture using a shortcode, I don't want to copy the link and paste it as other forums suggest because our editors will be the ones adding embeded links. I also do not ...
0
votes
0answers
28 views

Content Section Custom Anchor Not Working

I purchase WP theme (Techwise) and I found an issue with content menu sidebar in post page. that content not working as same (toc) Table of Content. it's not working with Arabic letters but working ...
0
votes
0answers
16 views

How can I to add css or js to wp_head from shortcodes or widgets? [duplicate]

How can I to add css or js to wp_head generated from shortcodes or widgets?
1
vote
2answers
72 views

Extending Shortcode attributes

I've searched many places and tried many ways for this but no success. I have a shortcode in my WP Theme like; [recent_posts layout="thumbnails-on-side" columns="4" number_posts="4" offset="" ...
0
votes
0answers
34 views

Plugin Error on activating

I'm building theme. but for custom post type, custom taxonomies and shortodes . I created the simple plugin. just plugin info and then functions to create CPT CT and shortcode. here is the example: ...
0
votes
0answers
20 views

Get the excerpt length to return attribute

I am writing a shortcode where I would like to set a number to an attribute and then return it in the excerpt. So the shortcode [excerpt_test=10 another_option=something] gets me the excerpt length of ...
0
votes
1answer
32 views

Nesting shortcodes results in the inner shortcode being placed AFTER outer shortcode

I'm trying to use nested shortcodes, but i'm having problems with it. Everytime i try to nest two shortcodes created by me... First declared in functions.php (the inner): function ...
0
votes
1answer
18 views

shortcode which is introduced into entry the blog, and appears in side bar

I have the following shortcode plugin, it works perfectly, nothing more I want to put you in the blog and appear in the sidebar, how I can accomplish this? I want not put a widget in the sidebar, ...
0
votes
1answer
185 views

How to insert HTML/CSS/JS into my iframe plugin?

I currently have an iframe plugin that displays on a WordPress page by shortcode. Currently I have been displaying websites in my iframes "src" but I recently came across an issue to display my very ...
0
votes
1answer
59 views

Create a shortcode to use in visual editor

I'm using Visual composer and i can't use php code inside boxes but i can use shortcodes. I know i must use function inside my functions.php file I need only a example/help for one and i will ...
1
vote
1answer
37 views

Can't understand $atts in functions?

I'm not sure if I don't fully understand the basics of functions in php or maybe it is WP convention that I am not sure of. My question is why use an argument in a function when it is not going to be ...
0
votes
1answer
54 views

Using $this from child class inside shortcode function

I am building many custom shortcodes and to off load a lot of reusable code I created an abstract base class for all my shortcodes classes to extend. However when I try to use a reference to $this ...
0
votes
0answers
78 views

Limit the number of successful logins

I would like to retrieve the number of successful logins of a user and act accordingly. If user logged in more than 10 times, then log out user automatically with wp_logout() or similar. I would ...
0
votes
2answers
82 views

Ajax not returning anything on form submit

I am working in wordpress and on pressing the submit button I want the function to return result through ajax and result should be shown as an alert on the screen. But when I press submit nothing ...
0
votes
2answers
43 views

how to create shortcode in wordpress

So I have the following code: <span class="delete"><a onclick="return confirm('Are you sure?');" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'my-delete-product', ...
0
votes
1answer
87 views

Woocommerce Filter Main Loop by Tag [closed]

Two questions: How can I modify the query results of the archive and search pages exclude the product-tag "audio"? How can I make the Recent Products shortcode of Woocommerce exclude the product-tag ...
0
votes
1answer
30 views

How to trace shortcode to its functionality

I am trying to modify a plugin and I need to trace its shortcode to the functionality page(s). Is there a way to parse a shortcode?
1
vote
1answer
85 views

Execute Closing Shortcode After the_content

I need to execute a short code on thousands of posts which don't already contain the short code as i've added some manually. I'm using another function to add the opening short code after the 2nd ...
0
votes
1answer
32 views

Saving post content to database with do_shortcode?

I'm working on a project where I use WordPress admin hooked up with Laravel. I use WP to edit and create posts and Laravel to query the database. I also use shortcodes. Is it possible to call the ...
0
votes
1answer
38 views

How to convert query sql to shortcode in wordpress?

I want to make a shortcode like this [myshorcode:2:drinks], and query-wrangler I have managed to get the following query that shows me 2 products of a certain taxonomy PHP WP_Query: $query = array ( ...
0
votes
1answer
44 views

Shortcodes: override a shortcode / change shortcode on the fly

I've done a plugin where you can add shortcode like this: [myplugin xx] (where xx is a number which calls a specific content xx). I have to do a multilingual version of my plugin, so here's my trick: ...
0
votes
1answer
23 views

How can I add 2 buttons with shortcode

I want 2 buttons in my blog post. One is "DEMO" and another one is "DEWNLOAD" . For Demo button shortcode I use this codes. function demo_button($atts,$content = null) { extract( shortcode_atts( ...
0
votes
1answer
43 views

Add shortcode support to custom field

I'm using CMB2 and I have a wysiwyg field, and I want to display a formiddable form in it by shortcode, but the shortcode is not rendering, but does render in a normal page or post. How do I enable ...
1
vote
1answer
39 views

<!--nextpage--> as a shortcode within the loop?

Anyone implemented this successfully? I want to include the <!--nextpage--> within a single post loop as a shortcode. I tried to echo it, the tag shows up but the post doesn't get divided into ...
0
votes
0answers
12 views

Custom short code pulling all tag IDs instead of selected ID

My server host recently detected malware in a script and deleted the files, causing the audio player plugin on my website to go bye-bye. I'm trying to restore but now the custom short code I wrote is ...
1
vote
1answer
78 views

Add attribute to shortcode dynamically

I'm looking to add an attribute to a shortcode used in a post dynamically. For example, say we start with: [shortcode-name] I'd like to add the "attribute=xxx" portion to the shortcode so it is ...
0
votes
1answer
16 views

Pre-populating new Page creation with shortcodes

I would like to have my authors to be able to create new pages on my site, but I would like a couple of shortcodes to automatically be included when they create each page. The shortcodes independently ...
0
votes
0answers
31 views

Previous/Next Post Link within Child Post

I am creating a custom plugin for Sensei by WooThemes that allows me to create custom shortcodes. Currently, I am working on a feature that lets me move to previous/next courses within lessons. As far ...
0
votes
0answers
14 views

Snippet for extern page

I am extremeley new to wordpress developing. My current situation is that I have created a plugin with a shortcode which i can insert into my wordpress site. Now I am wondering if there is a way how ...
0
votes
1answer
222 views

Display custom post type with shortcode

I have made a custom post type for my WordPress Theme and a page where the custom post types are displayed. But does anyone know how to make a shortcode that displays posts of a custom post type?
0
votes
0answers
6 views

How to fix the warning shortcode function generated by Theme Check? [duplicate]

I searched on the internet but I still don't know how to fix it. I solved most of the the errors in WordPress Theme I am developing except for one WARNING. Please refer on complete error lines below: ...
-1
votes
1answer
23 views

trouble with passing class method data to outside function

I'm attempting to call a function using this shortcode format: [priceguide file='test.csv' type='mods'] When I do this, all I get back on the page is the file name, test.csv, and nothing else. ...
0
votes
0answers
24 views

Ads below footer

A client of mine has ads on his website, which are managed by a CPT. The ads can be pulled in via a widget, hardcoded query and a shortcode. I have an issue that isn't consistent that I'm trying to ...
0
votes
1answer
62 views

How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

I have a shortcode, widget and template tag that need to load CSS. I am registering in init, and enqueueing as required. The only problem is, it is adding the CSS loader at the bottom of the page, ...
0
votes
2answers
62 views

Why aren't paragraphs breaking on this page?

This page is created using a recent posts shortcode included with my theme. It is not displaying paragraph breaks that I've added in the editor and I'd like it to. How can I get the shortcode to ...
0
votes
0answers
12 views

Problem with the_content() shortcode

The content from the footer pages on my website as well as blog post content is missing on my live site, although all is OK on my development service. There seems to be an issue with the short ...
0
votes
0answers
14 views

Does a String Replacing script affect shortcode output?

I have some javascript in the header that finds and replaces any phone number string in the static html output of the page. It's working great on strings that are outputted by the_content, but for ...
0
votes
0answers
43 views

Shortcode error

I've created a plugin that includes the shortcode below, it works fine one website ( http://www.porministries.org/wordpress/?page_id=16 ) but not on another website ( http://www.rccov.com/media/ ). I ...
0
votes
1answer
54 views

How to get_post_meta in a shortcode in excerpt on archive pages

I have a shortcode, [foo], which displays the value in a custom field. However, as it appears near the top of each post, it is included in the excerpt. function foo_shortcode(){ global $post; ...
0
votes
1answer
47 views

How to type shortcode-like text in WordPress TinyMCE visual editor?

Suppose, I have a plugin which is offering a shortcode for its users: [my-shortcode]. Now I want to post an advertisement in a page of my WordPress powered blog like the following: Hey you can use ...
0
votes
1answer
65 views

Change variable value for different shortcode attributes?

Suppose I have a function that needs to be able to load a file depending upon an attribute in a shortcode: [open_file ex1] How would I go about defining which file name is set as $csv depending ...
0
votes
1answer
54 views

Shortcode doesn't display in custom post type

I created a custom post type, but when i have added a shortcode for a slider it doesn't show the slider it shows just shortcode in text. and when i change get_the_content by the_content, it shows me ...
0
votes
0answers
33 views

Passing multidimensional arrays and associative arrays to plugin shortcodes

I want to pass complex structured data to a plugin I am creating. I have been using text strings in shortcodes with delimiters that are exploded into arrays by the plugin but things get increasingly ...