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.
1
vote
1answer
105 views
How to format shortcode's HTML in external file
I need to add a shortcode in my theme and I would like to put the HTML code not in the function which creates the shortcode but in a template file in my theme directory.
Now I have
function ...
1
vote
1answer
129 views
Adding option to Gallery shortcode
just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
1
vote
1answer
59 views
Enumerating shortcode attributes in JavaScript
I'm working on a plugin which uses a shortcode to call a JQuery function, and it requires three aspects to work:
The JQuery code + its own code, to be included on the pages it will be used on
The ...
1
vote
1answer
149 views
do_shortcode() doesn't work if shortcode contained in variable, works if shortcode passed as string
I'm developing a plugin, wherein one of the features is to switch out forms on a specific page by changing the shortcode within a custom field.
within my plugin file:
function getShort()
{
...
1
vote
1answer
65 views
Single post content custom order
In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text.
What I need is to add some condition in single.php so ...
1
vote
1answer
664 views
TED talks shortcode not working
I am trying to embed a Ted talk video using the shortcode:
[ted id=myid]
But it's not working. It shows the text instead of the video.
Is there any configuration I need to check to make it work?
1
vote
0answers
58 views
NextGEN Gallery- using shortcode for different galleries on different pages [duplicate]
Possible Duplicate:
conditional shortcode not working
I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery.
I ...
1
vote
0answers
122 views
Stop wptexturize from texturizing my shortcode
I have a script outside of Wordpress that generates an HTML file a few hundred times a day. I figured the best way to get the contents of this file in to a specific page would be a shortcode. I ...
1
vote
1answer
162 views
Buddypress shortcode for tabs
I want to add some more tabs like photos, videos on the user profiles of my buddypress site.
Is there any shortcodes or functions to add the tabs?
1
vote
1answer
74 views
Shortcode Not displayed at the Right Place [duplicate]
Possible Duplicate:
Shortcode always displaying at the top of the page
I am using custom shortcode to show some message at the end of the post. I am finding it hard to do so because it ...
1
vote
0answers
266 views
Pagination in a Shortcode. Get_next_posts_link not working but get_previous_posts_link works fine right next to it
I'm trying to output a custom post type archive using a shortcode. Everything works fine except for the get_next_posts_link part. The weird part is that it's right next to a get_previous_posts_link ...
1
vote
1answer
109 views
Shortcode with custom content attribute?
I am creating a shortcode for a client site that should display an image and a saying (mainly at the bottom of the page, but basically wherever the client wants to insert said image/saying). The ...
1
vote
1answer
177 views
Google Map Shortcode for Custom Taxonomy/Post Types
Calling all WP Stack Exchangers!
I am currently using Alain Gonzales' Google Map Shortcode plug-in on a site I'm developing, and it's worked just fine:
Google Map Shortcode plug-in on wordpress.org
...
1
vote
1answer
145 views
Get shortcode name from within it's callback function? [duplicate]
Possible Duplicate:
current_shortcode() - detect currently used shortcode
I'm dynamically generating shortcodes with my plugin like this:
foreach ($options['grids'] as $grid) {
...
1
vote
0answers
61 views
Using shortcode to display array in array
I am using a widget, U more recent posts. Seems to work with custom taxonomies when you input the correct data into it in a widget form, but the suggested shortcode doesn't work (and I am trying to ...
1
vote
1answer
387 views
get_the_content(“more…”) returns full text
I'm creating shortcode [latest_post] and want to show post date, title and short content. (content has "more" separator). Here is code:
function shortcode_latest_post() {
global $post, $more;
...
1
vote
2answers
595 views
Why Won't my jQuery Play Nice with Wordpress?
Code in question here: http://pastebin.com/PN29WKNq
It worked on the HTML page I tested it on. Its supposed to add "display: none" to the content divs and then add "display: block" when the ...
1
vote
2answers
329 views
Add the last viewed post title to a contactform with shortcode
I'm using the contactform 7 plugin and i want to add the title of the last viewed page (The page visited before the contact) to the dynamic field of the plugin with a shortcode. Is there a way to do ...
1
vote
0answers
93 views
include a post unrendered into a post, then render the whole thing [closed]
With a few extra lines in my functions.php I've created a shortcode that lets me include the content of a post:
function include_content( $atts ) {
$id = (int) $atts['id'];
if ( ! $post = ...
1
vote
0answers
234 views
Building a WP Shortcode: Loading Markers on a Google Map [closed]
I'm learning about plugins. I've built a basic Google Map plugin. But, I'm having problems putting markers on the map. I've pulled the lat long coordinates from a mySQL db. I'm following the Using ...
1
vote
2answers
484 views
Placing <div> tags on wordpress visual editor using shortcodes
Hello I need to have the following code on a specific page:
<div class="searchbar" >
<div class="searchbar-inner" >
search <input type="text" id="search" ...
1
vote
3answers
1k views
Custom form, shortcode, and submit handler
I have a frontend form with a bunch of input. My requirements force me to use a custom shortcode to create the form. I have already tested a page with that shortcode.
Here's my :
<form ...
1
vote
2answers
1k views
the_widget() and widget's ID
Let's assume I have a widget that displays only its name:
<p>
<?php echo $args['widget_id'] ?>
</p>
So when I drag & drop my widget to any sidebar it shows:
...
1
vote
1answer
424 views
Help with shortcode in admin-ajax [closed]
I've been playing around with ajax in wordpress and I've gotten my efforts to work on both back and front-end without too much trouble, however I've run into a problem getting post shortcodes to run ...
0
votes
1answer
117 views
Wrap text around shortcode
I use a shortcode handler in my plugin. The shortcode can have different (optional) parameters. And it should be possible to use for example 2 shortcodes on a static WordPress page with text before, ...
0
votes
2answers
215 views
PHP error with shortcode handler from a class
Currently i am using the following generic flow for adding the shortcode for a plugin.
class MyPlugin {
private $myvar;
function baztag_func() {
print $this->myvar;
...
0
votes
2answers
308 views
How do I create shortcodes for my wordpress themes?
I have seen many professional wordpress themes for sale that have shortcodes built in with which you could easily make posts like this:
[alert_box]This is an alert box which based on this short-code ...
0
votes
3answers
80 views
Shortcode outputs at the top of the_content
The shortcode produced by this function - a list of all sites in a multisite - outputs above the content in the loop, no matter where it is placed in the editor.
I've looked at the other related ...
0
votes
2answers
523 views
Make a Shortcode load after Post/Page Content?
I created a shortcode for time.ly's "all in one event calendar app" that makes a paginated list of upcoming events with out all the java script and user options.
I posted about it here. (Its still a ...
0
votes
1answer
93 views
Shortcode returns values in the wrong order
I have a shortcode function that returns:
return '<ul class="list-pages">'. wp_list_pages( $args ) .'</ul>';
Of course it returns:
{pages}
<ul class="list-pages"></ul>
...
0
votes
2answers
303 views
Inserting shortcode [stream /] into a Text widget
hi i'm trying to insert a short code into a Text widget but all its doing it showing the code and not processing it.
<?php echo do_shortcode(' [stream embed=false share=false width=500 height=560 ...
0
votes
2answers
46 views
How should I approach changing the template & $query as part of a shortcode's execution?
I am working on a project where I need to be able to change the template being used if a given shortcode is used. To complicate things more, the plugin must also be able to rewrite $query if this same ...
0
votes
2answers
283 views
Stripping shortcode from custom excerpt function
I'm using the following function to create a custom excerpt for my homepage and categories pages so I can do it by character count and have a custom "read more". However, I have captions shortcode ...
0
votes
1answer
951 views
Shortcode to display the latest news article within a page
Could someone help me write a custom shortcode to simply display the latest post anywhere in Wordpress? I've seen a lot of ways how to do this in pure PHP in a custom page template, but if I try to ...
0
votes
1answer
287 views
Removing Shortcodes from Child Theme
I'm trying to remove the shortcodes from a child theme.
In my functions.php file (for the child theme), I've put:
function my_remove_shortcode(){
return '';
}
add_shortcode('entry-twitter-link', ...
0
votes
3answers
397 views
Insert PHP code via shortcode?
I wanted to insert a form with a line of PHP code via shortcode. I am wondering if it's allowed? Has anyone tried it? Take the following for example:
function get_form($atts) {
return '<form ...
0
votes
1answer
414 views
Custom Shortcode Broken in Wordpress 3.1
A recent upgrade to wordpress 3.1 broke a custom plugin written to make use of shortcode in order to generate easy embed html for brightcove videos.
Can anyone see what is happening in the following ...
0
votes
3answers
1k views
Automatically added brs and paragraphs?
Here's my very simple shortcode:
function box_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'width' => 'auto',
'height' => 'auto',
...
0
votes
3answers
622 views
Shortcode attributes don't appear?
I'm working on my first shortcode, examples in Shortcode API are not suitable for starters, so I'm almost sure I'm doing it wrong!
My shortcode:
function hello( $atts ) {
extract( ...
0
votes
4answers
456 views
Problem with running javascript in a shortcode
I am trying to create this plugin for my site that will allow create short codes to pull data from the iTunes Search SDK. I already have the iTunes Search SDK javascript plugin working that pulls the ...
0
votes
1answer
174 views
shortcode help require
i am having a wordpress function to display the latest 5 tweets of the user,
this tweets can be displayed by two ways one is through direct entering the user ID in admin menu which i created, and ...
0
votes
1answer
598 views
Using shortcode in template file
this is shortcode in template:
function shortcode_frame_left( $atts, $content = null)
{
return '<span class="frame alignleft">'. do_shortcode($content) . '</span>';
}
...
0
votes
1answer
36 views
wp_query in a shortcode
I am trying to put several queries in a shortcode so that I can call them in a page instead of using custom templates. I got my query going but I only see some of the content on the page. The image ...
0
votes
2answers
93 views
Including javascript for a shortcode
I'm creating a plugin that allows a user to use a shortcode. This shortcode depends on a bunch of javascript that needs to be present once the shortcode loads.
I'm having issues trying to decide when ...
0
votes
3answers
142 views
How can I return shortcode output to the top of the content?
I have a shortcode called update which is used as follows
[update title='' date=''] this is some update, etc. etc. 2 paragraphs or more [/update]
This outputs some html that wrap the title, date ...
0
votes
3answers
102 views
Using shortcodes in PHP
I'm trying to use shortcode in my page, I'm starting with a simple test.
In functions.php:
function HelloWorldShortcode() {
return '<p>Hello World!</p>';
}
...
0
votes
2answers
171 views
Does Wordpress support a shortcode calling itself from within a shortcode call?
I've built a super-crazy Wordpress framework that has a million and one shortcodes, one of those is a columns shortcode which supports a count parameter that allows you to define a column and the ...
0
votes
2answers
60 views
Shortcode interpreted as text
I have the following shortcode in one of my pages
[[Intern: Termine/News]]
This works on a password protected sub page. Now I want that all news of the category Termine/News are on the parent page. ...
0
votes
1answer
45 views
My plugin won't return anything [closed]
I am trying to write a simple plugin to insert some post links in a post at the right place.
The query part works okay in a template, but my attempt at a displaying via plugin just returns a blank ...
0
votes
2answers
90 views
Custom shortcode breaks my page
Okay so I'm trying to create a wordpress shortcode called chapter, i.e. [chapter]text[/chapter].
What this does is it first checks if the content entered is already in the database, if it's not it ...