0
votes
1answer
54 views

Multiple do_shortcode in page template

Is it possible to nest multiple shortcodes with do_shortcode? Using visual composer and easytable with the visual editor, the classic editor displays: [vc_row][vc_column ...
0
votes
1answer
40 views

Shortcodes (with a space) added to php Sample

I have found only a small handful of posts from around the internet regarding Shortcodes and allowing them to work / execute within Admin Pages. So, I have made several admin pages in Wordpress, and ...
0
votes
1answer
62 views

Create special button on WP Tiny MCE Posts Editor for Shortcodes

I am trying to create a special button on the Tiny MCE editor on the Post Editor of Wordpress. I want to create a button for my created shortcode tooltips. Check out my desired output: ...
1
vote
1answer
36 views

How to Reference/Echo Variable from Another PHP Function

I have successfully set up a PHP function for my blog posts to create a shortcode to automatically display/style an iFrame tag for a YouTube video, as well as pull in the duration and view count ...
0
votes
1answer
49 views

Remove echo from shortcode

I've just started playing with shortcodes and due to my lack of php knowledge I am unable to figure out how to make this shortcode work without using php echo. Can anyone help me revise my code? // ...
0
votes
0answers
5 views

Run shortcodes in custom setting value that holds user supplied HTML in my header?

My plugin I built for a client shows a special header type banner/head section for a visitor on every nTH visit to the site. I have a setting where the user picks the number for nTH visit to show ...
0
votes
1answer
46 views

Change Spaces to Dashes?

I'm using this shortcode function to make flag icons. When you do [flag name="United States"], it outputs United States.gif and "United States" in the alt and title tags. However, I was wondering if ...
0
votes
2answers
40 views

How to have Function of a plugin using global vars into a shortcode?

I am trying to convert this piece of code into a shortcode so it can be used inside my posts. Is it possible? I cant think of how to do it as I am beginner in wordpress and learning via books/youtube ...
0
votes
1answer
71 views

Shortcode Display From Wordpress Dashboard Page Without Using post_id

I have this code for showing recent posts on my home page custom theme and it works well. functions.php code: function my_recent_posts_shortcode($atts){ $q = new WP_Query( array( ...
0
votes
2answers
49 views

Using Shortcode to Grab Archive Listing, Separate by Year

Here's code I've modified to display an archive list of every month I've posted news. Each month of course links to the archive for that month. I can then include the shortcode wherever I like. ...
1
vote
1answer
242 views

Recent post display using shortcode

I am trying to display recent post in static page home-content.php. I've added this code in function.php function my_recent_posts_shortcode($atts){ $q = new WP_Query( array( 'orderby' ...
0
votes
1answer
26 views

Shortcode for a Series of Elevating Image Files, Excluding a Range?

I'm not sure if shortcodes have the capability of doing this and could not figure out how to do it on my own. Is this even possible? I have a series of images in several folders outside of WP. They ...
0
votes
1answer
45 views

On selecting shortcode generate selected shortcode table inside page editor worrdpress

i want to create a different different shortcode while choose particular shortcode relative table is show on page editor for example when user choose [some_random_code_sc] that shortcode then relative ...
0
votes
2answers
56 views

Capitalize Shortcode Value on Output

I wrote this shortcode to take a filename I specify and output it as an image with title and alt tags: function cwc_pkmn($atts) { extract(shortcode_atts(array( "name" => 'http://', ...
0
votes
1answer
73 views

Replace shortcode in substring

I've created these two functions to toggle between the first paragraph of the content and then everything but the first paragraph so when the user selects 'More' it slides out the article smoothly ...
0
votes
2answers
124 views

Shortcode won't execute

I've created a shortcode using my limited knowledge, google, and stackexchange to do so. But when I load the page, it loads above the page contents and appears as html text. (shortocode text) ...
0
votes
1answer
31 views

Redirect loop upon installation of my plugin

I have created a plugin that uses a shortcode [MyCreditStatus] to display a form (multi-page form). This plugin uses an API that I also made. When I try to install the plugin, there are times that ...
0
votes
1answer
54 views

Posting code inside the post instead of in the template file using shortcode

I am using two plugins one of which is Thumbs Rating which have have a shortcode like this for example in order to display the thumbs rating option: The code bellow is to be used in the templates ...
-2
votes
2answers
96 views

Set variable in javascript and using in my shortcode

my script is function($) { var google_map_address = $('#address').text(); $(function () { $('#gmap').gmap3({ marker: { address: google_map_address }, map: { options: { ...
0
votes
1answer
40 views

Echo out element to another page.

I have a small plugin that displays how many submissions are left on current ninja form. And writes it out as so <p id="submissions-left">hurry only 25 submission left. <\p> And tacks ...
0
votes
1answer
34 views

How to get my [shortcode] rendered on the home page, other pages are fine

I'm using a child theme of Pixlex. The theme has a options panel to let me choose wether I want 2 or 3 columns on the home page and if those columns are to be filled with a post or page. I have one ...
0
votes
1answer
111 views

Including Custom fields within the_content

I’m designing a site for a client and I’m using custom fields for buy links to her books. I only want buy buttons to appear for fields that contain a URL, so I’ve hooked this just below the_content: ...
1
vote
1answer
72 views

Making Quote Plugin more efficient

I've been working on this plugin the past couple of nights and have been jotting down idea's of how to improve it. My knowledge of php isn't the strongest and I'm learning as I go along most of the ...
0
votes
1answer
331 views

How to call Shortcode categories for custom post types?

Hi I'm trying to do something rather tricky in my Wordpress Theme I'm more of a designer front-end developer so its a bit of a guess work with php. Anyone have any ideas why this code only displays ...
0
votes
1answer
399 views

Show contact 7 form in popup

I am creating map link on a image and it has two links to open video and contact form. I am making popup with lightbox but its not working. here is my code.. HTML <div class="map"> <img ...
0
votes
0answers
110 views

shortcodes not working -they just display as raw shortcode (code)

I'm developing a plugin and need to implement shortcodes, the shortcodes is coming out as it is on a archive/category page - I have used to the shortcode_exists(); to check if the shortcode does exist ...
0
votes
0answers
103 views

Do_shortcode on PHP file outside theme ALMOST works

I recently incorporated a new interface into my wordpress site that mimics an iGoogle layout. (If interested, It can be found here: Link and DEMO ) It uses several widgets to make up the layout ...
-3
votes
1answer
47 views

How to create shortcode of this PHP code

I tried a lot but failed to create shortcode of this PHP snippet: <ul> <?php $my_query = new WP_Query('post_status=future&order=DESC&showposts=10'); if ($my_query->have_posts()) { ...
0
votes
0answers
71 views

Using the same shortcode to show any table from the database

I have a little question for you. I want to create a shortcode that makes a table with data that I have stored in a database. But i want to send the shortcode an attribute, to specify which table ...
0
votes
1answer
44 views

How to Set Limit with WordPress Get Bookmarks Shortcode

I just need some help with a WordPress shortcode function. I would like to create a list of links based on the link_category inside a post with a shortcode. I had the shortcode working until I added ...
0
votes
1answer
56 views

Overwriting a Shortcode

I have a theme that extends the Visual Composer plugin with a slider on the front page. The slider will show five testimonials from five different customers. I want to add the featured image of each ...
1
vote
1answer
459 views

Get custom post type list for every category shortcode

I am trying to make a shortcode to list all custom posts under the category they are under. Here is my code and I am no expert of coding but i thought that this would work. If someone can tell me what ...
0
votes
2answers
490 views

Passing a shortcode attribute to a sub-function

This is both a WordPress and a PHP question, since a PHP programmer may know a technique that the WP group doesn't. I have been attempting to write a shortcode that fires the Foundation Reveal code ...
1
vote
1answer
192 views

has_shortcode() - how to detect nested shortcode

I'm using has_shortcode() to detect a shortcode, it works but not at all. If I put this specified shortcode inside another one the has_shortcode() function stops working. has_shortcode( ...
0
votes
0answers
43 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...
0
votes
1answer
49 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo ...
0
votes
1answer
710 views

ob_get_clean returns empty string, ob_get_flush outputs string

I am utilizing a template-type system, to filter the_content. My filter contains this partial code: ob_start(); include_once ( self::$dir . 'views/templates/' . $post_type . '/' . $display . '.php' ...
0
votes
2answers
68 views

get value from post to sidebar

I have the following div in my post, <div class="my_calss" id="my_id"> my content </div> Here, my_id is different for each post. I need to display my_id in sidebar into php code. ...
0
votes
1answer
81 views

Use PHP code in shortcode

Sorry I am not a coder and my English is bad, but I want do this: I have shortcodes: [tabs][tab title="Title1"]Content1[/tab] [tab title="Title2"]Content2[/tab][/tabs] How can I use PHP in this like ...
0
votes
1answer
231 views

How do I add text in a shortcode?

I think this might be an easier question but I can't figure it out. How can I add simple text inside a short code? For example: $return_string .= '<a ...
0
votes
1answer
28 views

Shortcoding with Divs

I am trying to turn a custom query into a shortcode but I am having some difficulty. Firstly, I am not sure how to return a custom thumbnail size via $return_string...in fact I am not sure how to ...
0
votes
2answers
170 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
0
votes
1answer
308 views

Why is my str_replace not working on short code submitted by front-end?

I've built a front-end post submission form that allows a user to include a shortcode provided by SoundCloud. SoundCloud shortcodes generally look like this: [soundcloud ...
0
votes
1answer
304 views

What is the difference between Null vs Empty (Zero Length) string?

In a shortcode context, is there any difference here? array( 'slideshow' => '', ), and array( 'slideshow' => NULL, ), Is there a best practice for that?
1
vote
2answers
712 views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
0
votes
1answer
42 views

Where to place PHP for shortcodes

My custom plugin is broken into two parts: a frontend.php and admin.php for loading code conditionally. Here is a rough outline of the code: <?php /* My plugin info here */ if (is_admin()) { ...
0
votes
1answer
116 views

Could use some help with Shortcodes

So I am starting with shortcodes and this is my first time trying to make one, I am using it to make css/js tabs for information and basing off code I got from themeforest.. So I will do the best to ...
2
votes
1answer
495 views

How do i get (unique) page name?

Like from the page of http://localhost/wordpress/about_us/ how do i get only the "about_us" ? Thanks
0
votes
1answer
477 views

Add number in increment of one to DIV ID

I'm using a shortcode to display a custom post type. The shortcode contains an attribute to display only posts of a specific category within the custom post type e.g. [faq category="travel"] For each ...
0
votes
1answer
194 views

Custom field within shortcode

I'm currently using the 'WP Simple Paypal Shopping Cart' plugin to get up a simple paypal e-commerce site, it's super easy to use, but to save the client having to write shortcode, I've set up custom ...