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)

-2
votes
1answer
31 views

Shotcode error on functions

Hello i have this shortcode that is generating a error. Can someone help? add_shortcode('do-action', 'do_action_shortcode'); function do_action_shortcode($atts, $content = '') {   ob_start();   ...
0
votes
2answers
165 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
0answers
44 views

Run function from parent on child site

I'm running a Multisite WordPress installation and have a couple of child sites. I'm trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone ...
0
votes
1answer
1k views

Custom wysiwyg editor doesn't execute shortcodes?

I encounter this weird problem.. I'm trying to create a simple & easy website for a client. He wants to embed video's into the page. I use different customfields assigned to specific elements in ...
0
votes
0answers
212 views

Creating a costing calculator plugin. How can the user create the calculations without coding?

I am relatively new to php & wordpress development. I am trying to create a plugin that allows the user to create an unlimited number of costing calculators. Users will be able to add fields ...
1
vote
1answer
109 views

show shortcodes in editor

Is there any way in which i can show custom shortcodes inside the editor panel, I have a bunch that I've created and thought it would be a good idea? Not found anything online other than tutorials on ...
0
votes
1answer
31 views

Prevent Menu Shortcode From Formatting

I'm trying to insert shortcodes into menu links (as I need to display a latest post link). I've figured out how to get the do_shortcode part done. However, when I insert a shortcode as the menu link ...
0
votes
2answers
558 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 ...
0
votes
1answer
104 views

How to wrap a text with shortcode into php file?

I want to wrap a text with shortcode into the single.php file. The shortcode is: [box type="note" align="aligncenter" ][/box] and the code is: Διοργανωτής διαγωνισμού: <?php ...
2
votes
1answer
234 views

shortcode for logo image

I have the following code for showing images using the shortcode image but the shortcode is [image name=logo] to load an image from /uploads/ directory called logo.png; changing the name I can load ...
1
vote
2answers
301 views

How to use/enable Pagination?

I'm creating a shortcode to display the list of users with a particular profile in WordPress. But I can not enable or display the pagination. I have 25 users on my site and would like to display 5 ...
1
vote
1answer
37 views

detect when shortcode ran for the last time

I'm wondering, given this code: add_shortcode( $tag , $func ); Is there a hook I can use that will always be called AFTER the last time $func was called, but soon enough, so I can still call ...
1
vote
2answers
543 views

Place the page title into the short code

I have created a short code called [contianer-narrow][/container-narrow] which wraps your content in a twitter bootstrap class: .container-narrow the issue is that the page title is not included. is ...
-1
votes
1answer
54 views

Creating Features List in Wordpress Post

I want to create features list in wordpress post. I know how to do in CSS but I was wondering if it can be done by using a short code or a plugin?. Like [features_list] Item 1 Item 2 [/features_list] ...
-2
votes
1answer
951 views

How to include custom field in shortcode (do_shortcode) in theme file

To cut out a few steps and make it easier for authors, I have included a custom field for authors to enter details (may include HTML). I want to add the custom field to a shortcode in the theme. ...
0
votes
2answers
1k views

Get shortcode attributes outside shortcode function

I'm writing a slideshow shortcode and need to grab the shortcode attributes in an external function so I can add the javascript to the footer. For example: add_shortcode('test','test_function'); ...
0
votes
1answer
368 views

Display meta data from a custom field within plugin Category Grid View Gallery

I am using this plugin, which creates a gallery of posts, fetching a thumbnail and the titles of the posts displayed in it. I have enabled Custom Fields, and have created (and filled in values) a ...
0
votes
1answer
137 views

Change the default video URL in a post to shortcode format

I want to add video from youtube/vimeo to my post.Whenever i add a video to my post ,there will display a link like https://www.youtube.com/watch?v=dsUXAEzaC3Q in my admin(Add new post ),and in the ...
0
votes
1answer
491 views

Create Short code dynamically

I want to generate short code for my gallery dynamically. For a single gallery, it is easy to create a short code for my gallery using add_shortcode( 'image-gallery', 'gallery' ) Now my question is ...
0
votes
1answer
107 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
1answer
57 views

Filter everything from content except output of a shortcode

Is it possible to filter the output of either the content or excerpt so that I only get the the shortcode output and so that if a user enters more than the shortcode the rest of the content for that ...
2
votes
2answers
2k views

Automatically add this attribute to the gallery shortcode

When inserting a gallery it adds the following shortcode: [gallery columns="6" ids="18,150,146,23,147,17,21,20,22"] I would like it to automatically add link="file" as the last attribute, whenever ...
0
votes
1answer
246 views

Multi-part form and wp_redirect()

For starters, it's a plugin (with a shortcode) or at least I would prefer it to be. I've got two issues both related to wp_direct. If form 1 validates I want to redirect to form 2, and continue the ...
1
vote
1answer
121 views

Shortcode for a link and thumbnail

<?php // Add Shortcode function blog_shortcode( $atts ) { // Attributes extract( shortcode_atts( array( 'id' => '', ), $atts ) ); // Code if (has_post_thumbnail()) { $url ...
0
votes
0answers
58 views

How can I join the two key with the two value of a custom field?

I am using wp add custom field with images and text multiple time .. how can join to have the key and value in the same div ? <div id="Caption-custom" class=""> <?php $text = ...
1
vote
1answer
60 views

Showing a different gallery in a seperate post

i am using the [multigallery] function and I was wondering if there is a way to use the function to call attachments from another post. For example if i was writing a post about taylor swift and I ...
0
votes
1answer
86 views

How to use shortcode inside of shortcode in theme

I am trying to place a shortcode inside another shortcode within a page template, however the various attempts I've made seem to not do anything. Here's how my code looks now - <?php echo ...
0
votes
2answers
1k views

IF Custom field value equals ZERO

I am trying to use the following code to check for my custom field for a value of ZERO to then display my div <?php $mp_price_sort = get_post_meta('mp_product_price'); if ($mp_price_sort == '0') ...
0
votes
1answer
220 views

Adding Image Count to Multigallery

Ok so I am using the [multigallery] function and it works fine, but one thing I want to add. Here is the code that I am using for the multigallery in my functions.php file function ...
0
votes
1answer
81 views

shortcode change variable base on user

How would I put this together. For plugin Contact Form 7 Data Base how would I add in the "Submitted Login" (user display name) to the search="name" Original Shortcode [cfdb-table form="Contact ...
3
votes
2answers
508 views

Using get_option() in JavaScript

Previously, I used the get_option() function to get an option in PHP, like this: $width = get_option('my_width'); This is inside a shortcode function. Now, I want to have an option in JavaScript. ...
0
votes
1answer
54 views

Which file renders the “Edit Gallery” Settings page?

I was looking for a tutorial on adding options to the "Edit Gallery" page. In the hopes of adding some GUI inputs that would result in the generated [gallery] short-code having custom attributes. I ...
1
vote
1answer
864 views

Add htmlentities and/or shortcode into data-attributes

I realize this is crazy but, I built up a filtered gallery with quicksand and it pulls in a larger image, title and description when you click the smaller image it shows the data-img in a larger form. ...
0
votes
1answer
171 views

How to change the output of gallery shortcode

I would like to add the media description as a data-attribute to each image of the gallery. All the other answers favour the solution to copy the whole code from media.php to functions.php and change ...
0
votes
1answer
84 views

Create a short code that inserts js

Note: People are assuming this question is already answered when in fact it is no where close to being the right answer. I have created tons of short codes, How ever I am using Jquery plugin TOC and ...
0
votes
1answer
2k views

Shortcodes, output buffering, and WordPress functions

I have a couple of long forms which I want to output as shortcodes. Shortcode API indicates that If the shortcode produces a lot of HTML then ob_start can be used to capture output and convert ...
2
votes
1answer
235 views

Global, network-wide shortcodes or text replace functions

What I'm trying to achieve is a simple text-replace functions, that would be available to any site in my Wordpress Network. Basically I want to: Change [--] into &mdash; (—), Be able to ...
0
votes
1answer
501 views

Wpautop stops working after get_the_excerpt

function pre_process_shortcode($content){ global $shortcode_tags, $shortcodes; // Backup current registered shortcodes and clear them all out ...
0
votes
2answers
283 views

Inserting shortcode is blanking excerpt - any ideas?

I wrapped a shortcode around my post content and I have noticed it is making the excerpt blank on archive pages instead of auto generating one from the_content/post. At a loss as to what is causing it ...
0
votes
3answers
533 views

How to put a form with php code into a variable or shortcode?

I'm trying to put my frontend form into a variable or a shortcode so I can wrap another shortcode around it (specifically Bainternet Post Creation Limits). My form has PHP code in it so I'm not ...
1
vote
1answer
466 views

wp_editor returns the shortcode and not render the output

I built a plugin, and I would like to use shortcodes in the integrated wp_editor. I'm using echo to display the content of the wp_editor, so I think that's the problem why I can't use the shortcode. ...
1
vote
0answers
85 views

Complex Slider Shortcode Help

I have a PHP-Code for Slider which I found. Now I want to transform it into a Wordpress shortcode. Here's the Code: <!-- Slider --> <div class="big-slider-wrapper block-full ...
1
vote
1answer
814 views

Responsive Embeds using default embed shortcode

Can someone explain how to make embed shortcode responsive? http://codex.wordpress.org/Embeds
0
votes
1answer
351 views

Get variable value based on string constant

In my plugin I define a constant as follows: define('DEFAULT_NUM', 5); I also define a constant representing the name by which I want to refer to this number: define('DEFAULT_NUM_NAME', ...
1
vote
1answer
676 views

How can a shortcode can take the place of the featured image in a post?

When there is a specific shortcode in a post (example [sc]anything[/sc]), I want to hide the featured and take it's place. How can I do that? I add this on my theme function // TopWide Shortcode ...
0
votes
1answer
510 views

Using shortcodes to parse POST request (containing the data from a front-end form)

I would like to allow my subscribers to post classifieds, which are nothing but a custom post type with a few metas for the price, etc. (The existing classifieds plugins I have tried are way too ...
0
votes
2answers
84 views

short code is not working in in custom wordpress theme it's only working in default theme

<?php /*template name: my template*/ ?> <?php get_header(); ?> <?php get_header(); ?> <?php echo do_shortcode('[STORE-LOCATOR]'); ?> <?php if ( have_posts() ) : while ( ...
0
votes
0answers
22 views

wp shortcode cannot show on accurate place of content [duplicate]

function show_menu_list_func( $prams ) { if(is_array($prams) && !empty($prams)) { $menuname = $prams['menu_name']; wp_nav_menu( array( ...
1
vote
1answer
1k views

Why are you using add_action for shortcode?

I would like to create shortcodes, some tutorials write about to use add_action add_action( 'init', 'register_shortcodes'); but I read tutorials where the author didn't use it, only put ...
0
votes
1answer
80 views

Custom taxonomy in short code

I am using short codes in theme for grid display. Code only considers category ids. I also want to add custom taxonomies so it give output as both category posts as well as custom taxonomy posts. ...