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)

1
vote
1answer
106 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 ...
0
votes
1answer
1k views

Shortcode output always showing at top of page

my shortcode output won't appear where I put it, but rather at the top of the content (top of the post/page content). And here is my code function service_shortcode_index() { global $content; ...
4
votes
2answers
2k 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?
2
votes
1answer
170 views

How to create tabled index of posts in a certain category

I have a tech blog, what I want to do is to create an index page for articles in a certain category. For example, I want all the articles under the category "WordPress BasiX" to be arranged in an ...
-1
votes
1answer
420 views

Create plugin/function to catch XML-data via Shortcode

I need to display data from an XML-file inside Wordpress posts, and I want to use shortcodes to do it. I have this XML-file witch I need to get the data from; ...
0
votes
1answer
881 views

Using do_shortcode with variables?

Struggling to get the format right for the PHP in this do_shortcode embed using variables from Advanced Custom Fields plugin. I think I've tried every variation on ., ', and ". After reading every ...
-1
votes
1answer
517 views

Applying if (get_post_meta) to new shortcode

It's my first time here so here goes :) I've created a custom image field which allows me to upload new images, or have images added via a form from the frontend. I want these to display. I'm ...
0
votes
1answer
312 views

Testing for a shortcode using a function. 404 page throwing PHP Notice

I'm using the following function (can't remember where I found it, but I think it was written by pippin so thanks to him) to test for a shortcode. function has_shortcode($shortcode = '') { ...
1
vote
2answers
318 views

How to split <p> text text text </p> into array

I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that <p>2012-12-12</p> <p>2012-6-23</p> ...
0
votes
1answer
136 views

Shortcode for tables which can include comma and linebreaks

Is it possible to make a shortcode for table which can include commas and linebreaks for its content? I've been trying to output something like this with shortcode: But it seems difficult. I tried ...
0
votes
1answer
2k views

Add custom attributes to a post

My blog is mainly composed of posts describing hiking. Actually, since I just moved from a Wordpress.com blog to a self-hosted Wordpress blog, every hike is inserted in a simple post. However, every ...
3
votes
1answer
1k views

Using wp_editor in shortcode

I am building a plugin for frontend submission. I am using shortcodes API to display the form for content submission, but I am having troubles. The problem is, wp_editor echoe's data, and shortcode ...
-1
votes
3answers
355 views

do_shortcodes() isn't working

I'm making a homepage template for my theme and I want to call a plugin, namely royalslider. Surely do_shortcode('[gallery id= "1"]'); Should do the trick?
0
votes
1answer
222 views

Create Widget or Enable Shortcodes in Sidebar

I'm well aware that WordPress by default does not process shortcodes in the sidebar. My question is why. I'm building a very small plugin that exports some content when the shortcode is present. This ...
2
votes
1answer
2k views

How do i reference the theme path in pages for images?

How do i reference images in a page/post without installing the php plugin or typing it out manually like this: domain.com/wp-content/themes/mytheme/image.jpg
-1
votes
1answer
140 views

Wrapping a function in html tag and return?

I am creating a shortcode. The shortcode will output a list of pages with the wp_list_pages() function. I am using the ('title_li') parameter and the list headline will be removed, because it is left ...
0
votes
1answer
250 views

Why is my custom post query shortcode only showing 1 post?

I created a shortcode for a custom post type so I can show the posts in a page. It works, except it only shows 1 post. here the code... anyone know what's wrong? // this is the shortcode function ...
0
votes
1answer
179 views

Don't show images inserted into content

I'm using a lightbox plugin to display my post images with [gallery], it works but those images show up in the content area too. So there are thumbnails and full size of same image. How can i hide ...
0
votes
2answers
126 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
915 views

conditional shortcode not working

I'm using a plugin, NextGEN gallery, to display photos. Each gallery from this plugin corresponds to a different sub-page, so I'm using conditional shortcodes to assign the right gallery to it's ...
4
votes
2answers
571 views

Show shortcode without executing it

I am trying to display code in my WordPress page and it isn't working. Everything I read says that you should be able to just use pre tag with code tag and it would be good but when I try to display a ...
0
votes
2answers
170 views

problem using $var for shortcode attr value

I am trying to pass a variable value to a shortcode attribute. I can't get it to work. Is the following supposed to work, or must values be literal? $mycat = 'books'; $myshortcode = '[products ...
0
votes
1answer
119 views

manipulate a plugins shortcode

I want to add some javascript directly below content, added by another plugin's shortcode. We are using the NextGen Gallery plugin and there are many articles containing the [nggallery] shortcode. I ...
0
votes
1answer
96 views

Wordpress do_shortcode first iteration

I've created a recursive shortcode that looks like this. [tabs] [tab state="active"]Home[/tab] [tab]About[/tab] [tab]Contact[/tab] [/tabs] [tabcontent] [tabpane]Content 1[/tabpane] [tabpane]Content ...
0
votes
1answer
3k views

call shortcode in javascript

I want to display a shortcode through jquery after the DOM is loaded: This is how I call the shortcode: <?php echo do_shortcode('[plugin]'); ?> Now, my question is how can I call that ...
2
votes
3answers
1k views

WordPress gallery 'post_gallery' filter doesn't work with feeds?

We can use the post_gallery filter to modify/replace the default WordPress gallery template (AKA output code) to suit our needs. But this doesn't seem to affect the markup in RSS feeds. No matter ...
-1
votes
1answer
38 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 ...
1
vote
1answer
211 views

plugin shortcode output

I have a plugin which uses this shortcode: [daisy] And the html output of this shortcode is : <a class="clickable">Click Here</a> Plugin is working perfect if I use the shortcode to ...
0
votes
1answer
193 views

display custom portfolio tags

This is a part from the code that is used to display portfolio categories: $post_cat = array(); $post_cat = wp_get_object_terms($post->ID, "portfolio_category"); ...
-2
votes
2answers
817 views

Shortcode attribute “title” doesn't appear in $atts array

In a post, I have this text: [bhours shortcode="test" title="test"] But the "title" attribute appears to be ignored. Here's a var_dump of the $atts attribute array array(1) { ["shortcode"]=> ...
1
vote
1answer
2k views

add_shortcode() not working inside of function

I have a custom post type bhour, with a field bh_shortcode. When a post of this type is saved, I'd like it to add a shortcode based on the post's value of bh_shortcode. If the value of bh_shortcode ...
0
votes
2answers
309 views

add php shortcode in return function

I have this part of code: return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'; What I want to do is to return also a php ...
2
votes
2answers
808 views

How do I preview the result of a shortcode in the TinyMCE editor?

I have created a shortcode via the Shortcode API that does something like this: [accordion_item numero="01" primeiro="true"]Item 01[/accordion_item] [accordion_conteudo] Lorem ipsum dolor sit amet, ...
-1
votes
1answer
289 views

Shortcode append to the the_content()

Currently I have a short that embeds a div into the the_content. This works fine like thus: [shortcode param=1 param=2] This returns a message at the end of the post, but within the current article, ...
0
votes
1answer
135 views

how to show last 5 images from the one post gallery

i want to get the 5 images of a one post gallery and show this random, example : [gallery id="123" orderby="rand" {numberpost=1 } or offset ? ] [gallery] codex tanks for help me.
1
vote
1answer
223 views

Function to show only first instance of shortcode

I need to add a function to my theme to remove additional instances of a shortcode in a post. First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...
1
vote
1answer
134 views

conditional tags- how to use with shortcodes

I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery. I planned on using NextGen to house the images in stylist specific ...
1
vote
0answers
64 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 ...
0
votes
1answer
284 views

Filters on the_content with plugins, pages and shortcode

I am using a plugin to add tweet, likes... This plugin add filters to the_content() to display this social buttons on a blog page (list of posts). I coded a shortcode which does a custom SQL query ...
4
votes
3answers
630 views

How to embed page content in a blog post

I've built an HTML table that is posted on a page in my site, and I'd like to use that same content inside a blog post (something of an announcement of the table's publication). The table is likely to ...
0
votes
1answer
196 views

Parse Shortcodes in Theme's Custom Field?

I have a theme which has a "PRICE" custom field that only accepts numerical values. Is there anyway to parse shortcodes in that custom field so I can dynamically display the price using another ...
1
vote
1answer
930 views

Gallery shortcode - change link file image size? (not using default fullsize image)

I am using this for my gallery - <?php echo do_shortcode('[gallery size="gallery-thumb" link="file"]'); ?> and I am using the jquery fancyapps fancybox. But some full-size images that are in ...
0
votes
1answer
857 views

How to Make Archive ShortCode

I checked that there is an shortcode on wordpress.com but it seems there is no build in way of adding the shortcode of archive on wordpress.org site. I know there was one plugin in repo but it's 2 ...
5
votes
2answers
2k views

do_shortcode() within Admin Page

I'm using a few plugins that have shortcodes ... however, instead of creating a public page for the content, I've created some new pages within the admin using add_menu_page and I need to know how to ...
3
votes
2answers
1k 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; ...
1
vote
0answers
215 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 ...
2
votes
4answers
3k views

How can I show the Jetpack Subscriptions form in a page? [closed]

In the Jetpack plugin, the subscriptions module can be included in your blog by following these instructions: To use the Subscriptions widget, go to Appearance → Widgets. Drag the widget labeled ...
1
vote
1answer
76 views

no content after shortcode

I hope you guys can help me with this little bug I've encountered. I am using a shortcode to display an audio player in the entries. This is the code i've put in my functions.php: function ...
-1
votes
1answer
89 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 ...
0
votes
1answer
2k views

How to build dynamic pages?

I'm new to WordPress so please bear with me. I have a requirement where I need to create a page that contains a lot of static and dynamic content coming from the db. What is the best approach to do ...