Tagged Questions

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

Have multiple loops on a page appear after/between page content

I created a function (in function.php) that allows me to put additional loops for different categories into pages: function custom_summary($atts) { extract(shortcode_atts(array( ...
0
votes
1answer
58 views

Manipulated shortcode output

I have a problem with a plugin I developed that registers a shortcode. The shortcode returns a string with valid HTML but some themes seems to manipulate the HTML returned by the shortcode, and I ...
0
votes
2answers
566 views

Passing a shortcode attribute to a sub-function

This is both a WordPress and a PHP question, since a PHP programmer may know a technique that the WP group doesn't. I have been attempting to write a shortcode that fires the Foundation Reveal code ...
0
votes
0answers
28 views

Automate post creation in wordpress

I have a database which has 2000 items. I would like to a) create a page for each item b) Create another page comparing two items. With 2000 items I can create thousands of pages. I am from java ...
0
votes
1answer
53 views

Modify a plugin function output from another plugin

I'm writing a plugin for a wordpress site using a page template using WP Types plugin. My plugin adds a shortcode tag. Shortcode tags inside 'the_content' get processed without problem. But this ...
0
votes
0answers
40 views

short code not working in custom post type listing, how to fix it?

Any activated plugin's short code not working while I listing all post from specific custom type, it's display short code as it is, but short code is not executing, my custom post coding is below: ...
1
vote
2answers
267 views

Shortcode: display list of created shortcode in popup

I want to create a popup shortcode in admin panel. I already create the shortcode button and a popup on button click. I want to display in the popup (not in the shortcode button), all my custom ...
0
votes
1answer
160 views

Passing variable in nested shortcodes

How can I pass style attribute of [boxes] shortcode to [box] shortcodes without using global variables? I don't want to use global variables, because I saw on a few articles that using global ...
0
votes
0answers
278 views

Gravity Forms Shortcodes not working on pages child pages

Am using gravity forms and am implementing on pages using shortcodes. I upgraded to the latest versions of both WP and GF and the forms stopped showing up for child pages, ie pages that have a parent ...
0
votes
0answers
20 views

How can I update the role of a newly added user when displaying the registration form with a shortcode?

Basically I have a shortcode that includes a registration form(among other things). The custom form itself is also included on wp-login.php and user-new.php if the default role is set to ...
0
votes
0answers
30 views

Where is escaped the shortcode?

I'm working with a function that returns a list of posts which has the same type as the actual post. Actually, it returns a list of links with title on anchor link and let to use it with a shortcode: ...
1
vote
2answers
104 views

Displaying a random user with a shortcode

I'm trying to setup a shortcode to show a single random user each time the page is refreshed. I've been successful in displaying all users or a select user by the user ID. Here is my shortcode as it ...
1
vote
0answers
355 views

Adding css to wp_head from shortcode

I'm trying to add CSS to wp_head, from within the method called to render a shortcode. I know that wp_head does not take any parameters, so I'm trying to figure out the following: The method called ...
0
votes
1answer
75 views

Youtube shortcode

I'm trying to make this shortcode work but without any success. All attempts gives me a white square. function youtube($atts) { extract(shortcode_atts(array( "value" => ...
0
votes
1answer
128 views

Using shortcode within shortcode with dynamic variable

So I've written a shortcode to generate a Loop (which shows the most recent posts), the shortcode is simply [loop]. Here's the code which outputs the content of each post (which is the bit causing me ...
1
vote
1answer
206 views

has_shortcode() - how to detect nested shortcode

I'm using has_shortcode() to detect a shortcode, it works but not at all. If I put this specified shortcode inside another one the has_shortcode() function stops working. has_shortcode( ...
0
votes
1answer
135 views

Form submission to another page returning 404 error [duplicate]

I'm modifying a form plugin, and trying to have it submit to another page chosen by the user. Right now the page it submits to is page_id=6. If I navigate to this page myself, it prints Array(). When ...
0
votes
1answer
371 views

Displaying shortcode in footer

Using SMOF as a backend admin and trying to include a shortcode in the text field for inclusion in the footer. I am generaing the shortcode as // Add Shortcode function copyright_shortcode() { ...
0
votes
0answers
16 views

How to change the title of google Analytics?

I am using google analytics in my wordpress site. I am showing the top viewed content using Google Analytics Top Posts Widget. I am using the shortcode to add them in my posts. My post titles were in ...
0
votes
0answers
34 views

WBR (word break opportunity) elements being inserted into shortcode $content in posts

Greeting all, I've written a simple WordPress shortcode which wraps inline $content in <code> tags. I see that sometimes the $content contains <wbr /> elements, which must be inserted ...
0
votes
1answer
253 views

I dont want to show shortcode in <pre> tag

I have a theme and I want to show vistors how shortcode format is in <pre> tag. But when I add shortcode in <pre>, it shows what shortcode does. I just want to show shortcode format in ...
1
vote
2answers
580 views

How to parse nested shortcodes?

The nested shortcodes won't parse correctly: [row] [col size="6"]...[/col] [col size="6"] [row] [col size="6"]...[/col] [col size="6"]...[/col] [/row] ...
0
votes
0answers
55 views

Shortcodes Ultimate pulse my widget in sidebar

I have create my website with sidebar is good for along time. In the recent day, I activate shortcodes Ultimate plugin with my website. I love this shortcodes but It effect with widget in sidebar. It ...
0
votes
1answer
44 views

How do I make a shortcode?

Learning as I go... I have this functionality built, but I need it as a shortcode. How do I do that? $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); ...
0
votes
0answers
52 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...
0
votes
1answer
82 views

Problems making shortcode with custom post types and taxonomy

I have a custom post type work-gallery and a custom taxonomy use which serves to categorize the posts. I am trying to develop a shortcode which enables me to output the work-gallery posts that belong ...
0
votes
1answer
378 views

Shortcode return $content vs do_shortcode($content)

I think the title of my question says it all. When creating a shortcode, I've seen some people do do_shortcode($content) instead of $content. What is the difference? Another thing, let's say I have ...
0
votes
0answers
269 views

Shortcodes in widget titles: attributes include quotes which are html encoded, why?

I wrote a shortcode plugin that works with widget titles. So I added shortcode support to widget titles like this: add_filter('widget_title', 'do_shortcode'); So my shortcode looks like this: ...
0
votes
3answers
579 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
1
vote
1answer
91 views

Videos via the video shortcode are always 640px wide?

I've run into a particular problem with the Video Shorcode of WP. I can't seem to change the size of the player with the attributes of the Shortcode. This happens on multiple sites with multiple ...
0
votes
1answer
88 views

How to add source code into wordpress post really?

Ok, I have read and followed the instructions as written in this link: http://en.support.wordpress.com/code/posting-source-code/ I have tried all other the solutions, including reinstall the whole ...
0
votes
0answers
77 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
0
votes
1answer
209 views

shortcode not working

I m working on content-product of woocommerce and doing shortcode in the template as echo do_shortcode ('[product_attribute attribute="Grams"]'); where Grams are in my backend as attribute and it ...
1
vote
2answers
976 views

Remove images from get_the_excerpt

I'm using a custom function to create a shortcode that displays the latest blog post on the home page of a template. But I'm trying to NOT have it display any images. I know I can use the Advanced ...
1
vote
2answers
325 views

enqueue script only if it is not already enqueue

I want to include a script in a shortcode output, so I am trying this: function my_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), ...
0
votes
1answer
52 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo ...
0
votes
0answers
101 views

Clarify: Enqueueing scripts within shortcode only loads in footer?

Each time I enqueue scripts inside the shortcode handler, it ends up in the footer. It doesn't matter whether I register them first and set it to load in the header, if I enqueue inside the shortcode ...
1
vote
2answers
80 views

Optimizing Query used for a Shortcode

So, I have this shortcode that produces a list of all published multisite and their pages. The network in question has about 50 sites in it. The problem is that loading the page I put the shortcode on ...
0
votes
1answer
48 views

call widget from within shortcode

I have a shortcode in my functions.php which runs a query on a category. I want to have a twitter feed on this particular page. I have a javscript option working on my page for twitter right now but ...
0
votes
1answer
218 views

Using Custom Post Meta Values in Shortcode

I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content. [my_shortcode post_id=""] I'm new to PHP ...
0
votes
1answer
231 views

Get attributes of nested shortcodes

When you've got your shortcodes defined like this: [myform] Foo: [mytextbox name="foo"] [/myform] And in your php: function shortcode_myform($atts, $content = null) { return '<form ...
1
vote
1answer
1k views

do_shortcode inside AJAX callback

I have an AJAX callback function inside my functions.php file, which displays posts in a specific category. add_action( 'wp_ajax_ajaxified_function', 'ajaxified_function' ); add_action( ...
5
votes
3answers
2k views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
0
votes
1answer
246 views

Wordpress core responsive video not working with shortcode

I cannot get the video from Wordpress core to behave responsively. I'm using the following CSS: .videocontent { width: 100%; height: 100%; max-width: 1024px; margin: 0 auto; } ...
0
votes
1answer
111 views

Passing values between enclosing and enclosed shortcodes

Is there a way to pass data between the enclosing and enclosed shortcodes? For example, I would like to do something like: [boxes per_row=4] [box]foo[/box] [box]bar[/box] [box]baz[/box] ...
1
vote
0answers
157 views

WP UI style within shortcode - Any Suggestions?

I am using the wp-ui Wordpress plugin to create vertical tabbed content. What I want to do is add a span to part of the tab title - to add some additional style, but the shortcode/plugin strips my ...
0
votes
1answer
64 views

Is it right way to create shortcode?

I want to create a shortcode, but it creates empty <p> tags in the output. I'm using the following code to avoid that problem, however I'm not sure if this is correct way. I have read that if ...
0
votes
0answers
78 views

How to detect shortcode usage, submit a form from widget to that page?

I've created a plugin and now want to create a widget containing a form that will submit to the page where my plugin shortcode is embedded from any wordpress page on the front end. I assume that ...
1
vote
0answers
201 views

How to protect parts of my code from TinyMCE modification when switching from text to visual mode?

I've got the following problem. When I switch from 'text' to 'visual' mode - TinyMCE is automatically messing around in the code doing unwanted things which breaks my styling - not so good ;/. Is ...
0
votes
1answer
148 views

WordPress Not rendering short code properly?

So I have other short codes that are built in this fashion and I cant figure out what i did between them and this one, This short code is used as such: [code code="function(){}"] to wrap your input in ...