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
0answers
200 views

Str_replace using shortcode with multiple changes

I am using a feed importer plugin which gives the option to use a short code in case I need to change data (in this case data for a custom field) on import, using for example: ...
0
votes
2answers
9 views

Access the resized images generated by `add_image_size()`

I have set up some shortcodes to make things simpler for the user. It wraps up some bootstrap markup and just lets you put the h1, some img urls, etc in it without getting too close to the markup. ...
0
votes
1answer
360 views

<?php wp_register(); ?> Display logged in user as “Site Admin” apposed to Logged in user

I'm just working on a little hobby word-press site I have; <?php wp_loginout(''); ?> <?php wp_register( '',''); ?> In the top rite corner of my site, <?php wp_loginout(''); ?> ...
3
votes
2answers
25 views

Audio or playlist shortcode condition according to the amount of files on attachment page

My reason for doing this is for a music & entertainment site where users will have the ability to share music and videos on other websites via embed code. I'm using the audio.php and video.php ...
1
vote
1answer
358 views

Shortcode are not working in Option tree textarea

I am using option tree. In textarea, i place shortcode [layerslider id="1"] its not working, i also found same post replied by plugin author allow shortcodes in textarea in option tree applied ...
0
votes
1answer
341 views

echo do_shortcode for Contact Form 7 from within dynamically loaded php file

I am loading a php file containing echo do_shortcode('[contact-form-7 id="568"]'); using jQuery .load() but the shortcode returns nothing. I have seen this question and answer and understand that ...
0
votes
1answer
20 views

get_pages() Returns Only One Item

I'm trying to list the children of a specific parent page for use in a shortcode using get_pages(). Unfortunately, only one page is being displayed though there are many more that should be displayed. ...
1
vote
1answer
628 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 ...
0
votes
0answers
19 views

Do a summary based on sections in a post

I wonder if it's possible in wordpress to create a summary, let's say at the begining of the post, that displays links to all the post section ? Example: [summary title="Summary"] [section]Title ...
33
votes
5answers
6k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
0
votes
1answer
34 views

Call/Run a Shell Script from Wordpress Page/Blog

Is it possible to run a shell script from a Wordpress page or blog post? There doesn't seem to be a plugin available or way to do this. The script would need to take values inputted in the page ...
0
votes
2answers
372 views

Custom Fields - Boolean Display of True/False to Yes/No

I am importing fields from a Real Estate site. The Import of one Custom Field looks like this... Field Name after Import ---> assistedLiving Field Value ---> false to output the display in ...
-2
votes
1answer
31 views

Shortcode conversion to hrml when post is published

I am creating posts in wordpress using shortcode. When user looks at post, the data is displayed by pulling from database. But we also send email to users when post is published. In this post, we sent ...
0
votes
2answers
53 views

Get first video from the post (both embed and video shortcodes)

The goal is to grab the first video (embed or shortcode) from the post. So we need to check post content if it has embedded videos ( supported by WP ) or [video] shortcodes. Multiple videos and embeds ...
0
votes
0answers
10 views

slide_panel id… shortcode not working [closed]

When I use the tag such as [slide_panel id='825'/ ] with the 825 being the ID of the panel data, Nothing shows up on the webpage. Here you can see the problem: http://imgur.com/a/lToiJ This has ...
0
votes
1answer
324 views

How to create a custom shortcode for custom login form?

I am trying to create a shortcode for the login form to use on a page. I have manage to get a simple form, but am looking to add the "forgot password link" Here is what I have so far ... any way to ...
0
votes
1answer
22 views

How to create a shortcode to display a category description?

I'm at a loss on how to create a simple shortcode out of the following code: <?php echo category_description( $category_id ); ?> Looking to create something in the line of: ...
4
votes
1answer
193 views

Show content only if member left a comment

Functions Php : add_shortcode( 'membervip', 'memberviparea' ); function memberviparea( $atts, $content = null ) { if( is_user_logged_in() ) return '<p>' . $content . '</p>'; ...
2
votes
1answer
787 views

Custom shortcode in widget forced to top of widget

A custom shortcode i made is being forced to the top of the widget outside of the widget container. Any ideas why? This is my code... function nktmediaplayer_func($atts) { ...
0
votes
2answers
20 views

How Wordpress Displaying Shortcode In Post Content?

I want to know how wordpress displaying shortcode inserted in post content, so I can replicate what it does and implement it to my plugin. Here is an example: I want to show shortcode inserted ...
0
votes
0answers
30 views

Different ID in every shortcode

I am trying to make an Instagram-box on the author profile of my page. I need every profile to be different, and to do that I need to change the ID in my Instagram Widget-shortcode on every page. The ...
0
votes
0answers
12 views

Why would one WP installation have an issue with a space in a shortcode variable?

I found a workaround, so the client site is fixed, but I don't like the fact that I don't have a cause, so I'm hoping one of you might have experienced this and know the cause. The client suspected ...
1
vote
1answer
1k views

Audio and video shortcodes not working properly

I'm having some trouble with Wordpress's built-in shortcodes for audio and video. When I embed a video, it basically gives me a black box and has a link to download the file at the top; when I embed ...
3
votes
1answer
877 views

TinyMCE popup windows using WP functions

In my editor I would like to use a TinyMCE generated popup to insert in the textarea some complex shortcodes. I use the TinyMCE API to show the popup (bottom of this question). The popup is a PHP file ...
0
votes
0answers
11 views

Undefined offset from theme function with preg_match

I am trying to process ifttt [source_link] shortcode with function I found around. It works, but annoys in admin page with this error code: Notice: Undefined offset: 2 in /home/.../functions.php ...
0
votes
1answer
41 views

<p> tag breaks shortcode output (other solutions don't work)

I just encountered weird problem. My shortcode output which is something like '<span class="link_container"><a href="#">'.$content.'</a></span> <div ...
0
votes
0answers
19 views

Display page/post content with Ajax - Shortcode Issue

Sorry for my english :) I am trying, for my new portfolio to load content post on home page with ajax. It's almost ok. I got issue with shortcode. I try many thing (iframe, but it not i'm looking ...
1
vote
3answers
2k views

Wordpress removing <p> tags?

I'd already come across a case where Wordpress added <p> tags. However now I'm dealing with the opposite situation. When I add [] shortcodes inside <p> tags WordPress automatically removes ...
1
vote
1answer
394 views

wp_specialchars and wp_specialchars_decode in a shortcode plugin

I have written my first plugin, a shortcode plugin. I have read about wp_specialchars and wp_specialchars_decode but I'm not sure how to use them. The plugin read a shortcode allowing some parameters ...
0
votes
2answers
683 views

Insert wp gallery shortcode into custom textarea

Is there a way to insert wp gallery shortcode into custom metabox textarea ? I would like to have something like this: New metabox in post/page with textarea and below textarea there are a button to ...
1
vote
1answer
57 views

Execute shortcode twice in the same page

I need help with a shortcode question. I have this code: add_shortcode("archive", "archive_render"); function archive_render($atts) { extract(shortcode_atts(array( "rientro" => "no", ...
0
votes
1answer
22 views

Wraping $content into link with shortcodes

I'm working with shortcodes in WordPress and I struggle with one problem. I'm trying to wrap my $content into tags, but it doesn't work properly. So here is my shortcode function: <?php ...
0
votes
1answer
433 views

Custom registration form in shortcode getting internal server error 500

I created a custom registration form which works fine when used as a custom page template. I needed it as a shortcode so I created a shortcode using the function below /* Custom shortcode */ function ...
0
votes
1answer
15 views

Can not get shortcode content in function

I use a shortcode on my page like [homepage_featuredproducts]test[/homepage_featuredproducts] In my functions.php function homepage_featuredproducts( $atts , $content = null ) { ...
0
votes
1answer
12 views

Expanding a function to call a plugin or show a link

I have added the following code to my functions.php to validate if a user is logged in before allowing them to fill out a form: function my_members_only_shortcode($atts, $content = null) { if ...
1
vote
2answers
326 views

Custom Shortcode and Button not Working after 3.9 update

I have added a new button that creates a short code but it seems that after the newest WordPress update, the button is not working any more. The button is visible but when someone clicks it, nothing ...
0
votes
1answer
36 views

shortcode order for event custom post type

ok im working on a website using post type event with post_meta event_start_date, i created a shortcode and everything is displaying fine except for it displaying in order, it seems as its not ...
0
votes
1answer
53 views

sql query in shortcode not working

I have a custom table 'wp-products' in WordPress with the following fields id (primary key) e.g 1 make e.g. ford model e.g. mustang price e.g. 17500.00 id ...
0
votes
2answers
382 views

Change font-size within a shortcode

I have a simple shortcode like this.... function myshortcode( $attributes, $content = null ) { extract( shortcode_atts( array( 'class' => '' ), $attributes ) ); return ...
1
vote
0answers
26 views

How to have different captions for same image, for galleries?

Seems like I can't have the same image in different galleries with different captions. Is it possible to make that working in any way? Like if we could change the shortcut code that Wordpress is ...
0
votes
1answer
64 views

Wordpress Gallery with ID's Shortcode not Working

Currently, the code below runs well if I use the old gallery shortcode that looks like this [gallery] . However, after Wordpress 3.5 update gallery shortcodes now include the image IDs by default that ...
0
votes
0answers
19 views

How to output different content of page on different places in my template

I have a special template for my homepage. There are many different boxes, and in every box I want to have different content. That should be possible to create over the backends page edit function. ...
2
votes
1answer
41 views

Shortcodes: Pros and Cons

We're about to start developing a new relatively simple widget in the form of a plugin for a specific client job - but want to create something that will be usable on future projects. This plugin ...
1
vote
1answer
465 views

Shortcode in AJAX popup

I am trying to use a shortcode from Ultimate Facebook plugin to display a FB connect button in an AJAX popup and can't seem to get it work properly. I searched and used the solution given by djb in ...
2
votes
1answer
49 views

Always use <figure> for post images

The default behavior when it comes to full-width images in posts is this: If you insert an image alone, this HTML structure is produced: <p><img/></p> If you insert an image with a ...
5
votes
3answers
4k views

Check if post/page has gallery?

I'd like to run some code only if a gallery (inserted with the [gallery] shortcode) has been inserted into a post/page. I did the following: gallery_shortcode($post->ID) ? $gallery = 1 : $gallery ...
0
votes
1answer
281 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; } ...
1
vote
1answer
121 views

Custom Loop Using Shortcode in Custom Page Template

I am trying to output a custom loop created using shortcode in a custom page template. Here is the code I am using to generate the shortcode: function archive_sc( $atts ) { // Attributes ...
0
votes
1answer
424 views

WP_Editor Shortcode Issue

I have created a front-end editor using wp_editor that functions as it should. Upon testing I have noticed that it is stripping out any shortcodes that have been inserted in the content. I have ...
0
votes
1answer
59 views

ACF Shortcode bringing in my shortcode is adding unnecessary line breaks

At the VERY core, my question is - how to remove linebreaks on a single ACF field that is inserted with the ACF shortcode. I have a lot of "shortcodes within shortcodes" here so I will walk this ...