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

Basic custom Shortcode not working

This is the simple version of what im trying to accomplish //add display_name shortcode function name_shortcode( ){ return "testshortcode"; } function register_shortcodes(){ ...
0
votes
0answers
37 views

Change Gallery Shortcode Image Size

I am developing a WordPress theme and have a few posts with galleries (displayed via Jetpack slideshow). Gallery example: [gallery type="slideshow" size="full" ids="1672,1682,1674,1670,1676"] ...
-1
votes
1answer
20 views

Custom shortcode not being included in content paragraph [duplicate]

Ive created a custom shortcode via functions.php to display a phone number in the content when the shortcode is used in the WYSIWYG field. function contact() { $contact = ...
0
votes
1answer
28 views

Using shortcode to stop post content from displaying

Is there any way to use shortcode to block the display of the post content? What I want is to use the shortcode to pull the post content directly from the database, manipulate it, and then display it ...
-1
votes
2answers
36 views

shortcode doesn't work

I made my first WP plugin, it is a contact form - here is the code: <?php /* Plugin Name: Example Contact Form Plugin Plugin URI: http://example.com Description: Simple non-bloated WordPress ...
3
votes
3answers
88 views

How to add 'class' attribute into shortcode [audio]?

I would like to style two MediaElement players on the same page differently, and figured out the easier way to do this (compared to adding a completely new shortcode and enqueueing a new stylesheet, ...
0
votes
1answer
52 views

Replace custom gallery shortcode with default gallery shortcode

I want to replace my custom gallery shortcode in my post content with the default Wordpress shortcode (in pre get posts). I will be doing this in only a certain instance where it will need to be ...
-1
votes
1answer
91 views

Modify Blog Module layout in Child theme

I need to adjust how the featured image is displayed in their blog module. I need to change the display of the Featured Image from an IMG tag to a Background Image. So I can modify the frame (DIV) of ...
0
votes
1answer
51 views

Check if CTP category taxonomy is set in shortcode

I have created a custom post type with the ability to add categories (taxonomy). Taxonomy function create_cat_tax() { register_taxonomy( 'cpt_cats', 'cpt_faqs', ...
0
votes
2answers
30 views

Change post type depending on shortcode

Is it possible to use 2 shortcodes with the same function and change only the post type in the function depending on what shortcode it is? For instance, when I use all_faq shortcode the post type ...
0
votes
1answer
28 views

Custom Post Type for Shortcode Use - Prevent it display as a post (with slug)

I've developed a series of plugins which can display categorised custom post types via shortcodes, along the lines of: [myshortcode myshortcodegroup="groupname"] This works just fine, however, I ...
1
vote
1answer
62 views

Remove &nbsp; from shortcode

I'm not sure why I can't get this to work. I'm trying to remove the &nbsp; that is added inside this shortcode... [box] Text [/box] Which results in this HTML output: <div ...
1
vote
2answers
97 views

How can I get the [video] shortcode to allow query string parameters?

Using WordPress 4.4.2 (latest version as of writing this) I'm trying to use the [video] shortcode to show a video on my site. If I provide a url ending with the filename.mp4 it works fine: [video ...
0
votes
0answers
30 views

Wordpress not responseing headers to download a file

I have a WP plugin that sends a link to an email to download a file in hidden location. User selects a file, then a token containing the file ID etc. is written to a database, and a link is sent. Upon ...
0
votes
1answer
68 views

Create category post shortcode

I'm trying to create a shortcode for my theme without using plugins. I tried this http://wpgeneratetool.com/short-code/ but i can not figure out how to create. I want to create something like the ...
1
vote
1answer
64 views

Is it possible to ignore the first Line Break in a preformatted Div from a shortcode?

I created a shortcode of [pncode] that lets me enclose some programming syntax and apply some styling. Notably, it preformats the text and makes it monospace (full CSS below, if it helps). In the ...
0
votes
0answers
15 views

Choosing what Shortcodes should render

So I am working on a mobile app that pulls from a WordPress JSON API, I've coded our own end point and it's delivering content just fine. I need a way to be able to pick and choose what shortcodes ...
0
votes
0answers
14 views

Gallery IDS and Captions: hide/show on a per ID basis

I am aware of hiding captions in a gallery via css on figcaption, like .wp-caption-text/.gallery-caption for example. What I am looking for is a way to have custom control of hiding captions on ...
0
votes
1answer
68 views

Check if the current shortcode is being used in a widget

How can I check if the current shortcode is being used in a widget? I need to disable some shortcode options that are not allowed in a widget. Someone know how?
0
votes
2answers
46 views

How can I fix those issues generated by the Themecheck plugin

I've got the following error messages on the themecheck plugin in my WordPress theme. REQUIRED: The theme uses the register_taxonomy() function, which is plugin-territory functionality. ...
0
votes
1answer
30 views

how to add acf value to other plugins shortcode?

Hi I am creating site with ACF and other plugin (WP-Appbox). WP-Appbox allow me to add little download box of app with shortcode. shortcode is as follow. [appbox storename appid]. If I want to show ...
0
votes
1answer
26 views

Do not show child pages of child pages

I'm looking (without having to copy the whole code) that when the child page has child pages of it's own that it wil not show those child pages but still the parrent page 2 levels up. i played with it ...
1
vote
0answers
18 views

WordPress TinyMCE : Get value of popup button

I'm developing a shortcode plugin, with a main button and sub-menu buttons for each shortcode, I create bootstrap thumbnail shortcode with a popup button for parameters like : Thumbnail Title Insert ...
1
vote
1answer
50 views

accessing wp.media api from a tinymce plugin

I'm trying to create a tinymce plugin that generates a shortcode containing two image ids: [image-fade old="xx" new="yy"] I would like to let users select images directly from the media selector ...
0
votes
1answer
29 views

Correct usage of scripts with shortcodes

I'm not sure I correctly "insert" scripts in my pages. Concrete example: I need to generate a map with the google API, and decided to write a plugin to do that. Question now is what is the correct ...
-3
votes
1answer
34 views

Create a shortcode to display the “the_content ()” in my post [closed]

I should create a shortcode to display the contents of the post in my template. Could someone help me? I made a shortcode to display the form of comments, this just can not unfortunately. Thanks ...
0
votes
1answer
46 views

tax query shortcode

Configuring my shortcode with tax query is proving dificult. When i omit the params for taxonomy/terms i get nothing back. This returns 1 post back as expected [loop post_type="website" ...
0
votes
0answers
60 views

Override shortcode in child theme

I want to change a shortcode behavior in my child theme. The shortcode.php location is: /themes/xxxx/framework/helpers/shortcodes.php the code inside this file is: class SH_Shortcodes { ...
-1
votes
2answers
70 views

Enclosing shortcodes create line breaks

I created enclosing shortcodes like this: //[rezept] function rezept_func( $atts, $content = null ){ return '<div class="drl-rezept-wrapper">'.do_shortcode($content).'</div>'; } ...
-1
votes
1answer
42 views

woocommerce Product shortcode create

i am very new wooCommerce and WordPress. programming knowledge not strong yet. but for my project i need to do something. now i want to create custom short code for woocommerce product. i want to ...
0
votes
1answer
46 views

Change the default video shortcode

When I select a video file from media library and click on insert in to post button that time it goes like this : [video width="1280" height="720" ...
0
votes
1answer
68 views

Shortcode for Visual Composer Grid fails turning string to integer

I am working in a shortcode for visual composer grid. I want to show the list of terms of a taxonomy (portfolio_tag) associated to a custom post type (portfolio). The shortcode gets the ID from the ...
0
votes
0answers
33 views

TinyMCE custom button on post-new.php screen

Iam building a small slideshow plugin. For this I registered a new post-type which is called "prfx_slide". And also set-up a shortcode function so that I can use the slider as a shortcode. With the ...
0
votes
0answers
31 views

Override plugin shortcode declared as a Class

There is a class which is a shortcode from commercial plugin for WordPress I need override method /** * Rendering the shortcode this class is responsible for. * * @return string ...
0
votes
1answer
17 views

How to create an incremental list using shortcodes?

Right now I'm creating shortcodes like this: function short_code($atts) { $a = shortcode_atts( array( 'name' => '' ), $atts ); return '<div class="content"> <div ...
1
vote
1answer
48 views

Using API to generate short link

I want to use a shortcode that generates a short URL from API of Premium URL Shortener script. I added code from API to my template functions: // Main Function function shorten_url($url){ ...
0
votes
1answer
33 views

Ordering get_terms with ACF not displaying all terms

I'm making a shortcode to return all the terms in this taxonomy. The terms are sorted with krsort by the custom field 'height' made from ACF. I'm following this answer from here. The problem is it's ...
0
votes
1answer
50 views

Trying to Understand Shortcodes.

am completely stumped on this for some reason. I have block of code that I had in my header.php <?php if ( is_page("Home") ) { if( have_rows('slider') ): ?> <div ...
1
vote
2answers
51 views

shortcode_unautop shortcode not functioning

I have made my own theme with shortcodes to WordPress. In my filters I have: remove_filter('the_content', 'wpautop'); add_filter('the_content', 'wpautop', 99); add_filter('the_content', ...
1
vote
0answers
41 views

Is it possible to delay execution of shortcode output callback?

I have a problem : shortcode output callback triggered too early. /* Defined in plugin constructor */ add_shortcode( 'foobar' , array($this,'pre_render_routine')); function ...
1
vote
1answer
54 views

Different loop output every x posts in custom post type

I was following along in another StackExchange Question from a couple of years ago where there was a layout along the lines of: <div class=items active> <div class=row> ...
-1
votes
1answer
35 views

Insert shortcode in widget area

I enabled the Insert Pages plugin wich allows to create a shortcode for a given page e.g.: [insert page='7' display='all']. See my capture of the setting of the plugin: ...
1
vote
3answers
47 views

How to use shortcode in js url

Here's the code I'm trying to use. <input type="button" class="next-step" value="Adopt Now" onClick="parent.location='http://example.com/adoption-application/?Name=[Title]'" /> The shortcode ...
1
vote
0answers
76 views

wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query

I'm implementing a form for a frontend post with a shortcode. The form is processed in the same function, reloading the page: function adicionar_ninhada(){ $user_id = get_current_user_id(); if ...
1
vote
0answers
26 views

Shortcode: text content ends up outside html tags

I have a shortcode which loops through a custom post type. It is supposed to output a link and a title for each post. But the result is that the divs and link tags that are created are empty, while ...
1
vote
1answer
53 views

Shortcode for CPT post content in a page

I use the Wiz theme along with a plugin I'm coding. The Wiz theme comes with Visual Composer bundled and theme options for pages (header, sidebar, footer and the like). However those options are ...
1
vote
1answer
36 views

Shortcode returning localized HTML part

Here's my issue. I made a shortcode which makes a related article section in post content. Here's the content of this function: $a = shortcode_atts( array( 'id' => 0, ), $atts ); ...
3
votes
1answer
37 views

Wrap each shortcode in array to div

i'm trying to wrap each shortcode in div with special data attributes, but when i'm using nested shortcode they don't wrapped, where i'm wrong? thanks public function wrapShortcode( $content ) { ...
1
vote
0answers
84 views

Displaying recent posts on static page with template-part via shortcode

So, I'm taking my first shot at creating my own custom Wordpress theme with Underscores. I have everything straightened out, with the exception of one last thing I want to add. I would like to add a ...
2
votes
1answer
34 views

Remove HTML content if attribute is not set / variable attributes

So I'm creating a shortcode that uses the standard bootstrap carousel. It works completely fine as long as all the 3 slide attributes are entered correctly but obviously if only 2 are set and the ...