0
votes
2answers
34 views

check if the user is owner of current page

I am struggling with this little problem. I have a user profile page and I want to change some of the content based on whether it is my own profile og someone elses. This is my code to add a shortcode ...
-2
votes
1answer
26 views

PHP error in shortcode [closed]

Can anyone help me see the error in this code? I'm trying to implement a function via shortcode which I found here: <?php if (function_exists(‘wooslider’)) echo do_shortcode(‘[wooslider ...
3
votes
1answer
49 views

Autogenerate wordpress shortcodes using array?

I was create a shortcode which automatically generate shortcodes with given array key and value. Function names does not generate dynamically. Note: Array KEY = ShortcodeName and Value = Wordpress ...
0
votes
1answer
60 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
46 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
45 views

Getting categories from DataBase & WP Favorite Post

I am trying to create a shortcode that pull the most saved posts (using WP Favorite Post) and displaying them by YEAR, MONTH or CATEGORY. So far I have been able to get the year and month working ...
0
votes
1answer
153 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
0
votes
0answers
37 views

Shortcode to get child pages of multiple parents (using parent slug)

I'm using a nice shortcode to get the child pages of a specific page, using just the parent page slug. [getChild name="page-slug"] This is done using this code: function getChild_function($atts){ ...
0
votes
2answers
39 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 ...
1
vote
1answer
225 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
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 ...
0
votes
1answer
29 views

Trying to the deduce shortcode from a function

I have a theme where the wysiwyg button to insert the shortcodes is not appearing. I am trying to manually type in the shortcode that would output the tabs that I need. I am looking at the function ...
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
87 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
1answer
209 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
0
votes
2answers
80 views

How to display data from custom fields in my custom shortcode?

This is the shortcode I have come up with, according to a tutorial on Dig WP (http://digwp.com/2010/01/custom-query-shortcode/) in order to display list of songs on specific albums. [loop ...
0
votes
1answer
104 views

Modify function Shortcode_atts

function get_date_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'asc', 'orderby' => ...
0
votes
1answer
55 views

Function shortcode - Set Parameter

function get_gifts_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'desc', 'orderby' => ...
1
vote
1answer
143 views

Super simple shortcode not working

Have been looking at various tutorials and answers here and elsewhere and just can't get this to work. Just trying to display a simple output from a shortcode as below, but it is just outputting the ...
0
votes
1answer
96 views

Pull random comment from specific post, display on homepage with shortcode

I'm trying to display a random comment from specific posts on my homepage, using the solution that was provided here: ...
0
votes
0answers
481 views

Set thumbnail from URL, by grabbing image in functions.php

So I've written a whole bunch of functions, which are used to display Vine videos. I then have a shortcode which outputs the code. The last thing I have to do is set the post thumbnail. I want to be ...
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 ...
0
votes
1answer
65 views

Shortcode to output get_header not working

I'm trying to create a shortcode that will output the contents of one of my template header files. I created the shortcode in my functions.php file function zoo_header(){ return ...
1
vote
2answers
95 views

Displaying a random user with a shortcode

I'm trying to setup a shortcode to show a single random user each time the page is refreshed. I've been successful in displaying all users or a select user by the user ID. Here is my shortcode as it ...
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
0answers
74 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
1
vote
2answers
845 views

Remove images from get_the_excerpt

I'm using a custom function to create a shortcode that displays the latest blog post on the home page of a template. But I'm trying to NOT have it display any images. I know I can use the Advanced ...
1
vote
1answer
132 views

Shortcode inserts paragraphs before and after executing shortcode

When my shortcode is executed, it inserts a <p></p> before and after the shortcode. My shortcode is the only thing in the text editor of the page. There is not a newline before or after ...
0
votes
2answers
122 views

Adding an option to a shortcode

I'm trying to write a shortcode that will allow the option to display all users or show a singular user, defined by a user id or "nicename". The shortcode would look something like this: [staff ...
-1
votes
1answer
299 views

Insert Shortcode exactly at the end of the content

<?php echo do_shortcode("[sharethis]"); ?> <?php wp_related_posts()?> There are 2 short codes above 1) share this plugin short code 2) related posts short code now my ...
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
0answers
51 views

using enqueue_script in a shortcode isn't working

I'm new to wordpress and I'm trying to get this to work by following the wordpress codex but I feel like I must be missing something obvious. I have a child theme based off of a parent one, and I ...
1
vote
1answer
72 views

Display gallery on bottom after content

How to execute the gallery shortcode after any other content no matter where the shortcode is in the post HTML? Thanks.
1
vote
0answers
101 views

Add button to kitchen sink toggle

I have created a simple function along with a shortcode, my goal is now to add a button in the sink toggle of wordpress so that the user doesn't have to type anything. Is this hard to achieve? how ...
0
votes
0answers
43 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
875 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 ...
0
votes
2answers
79 views

How to use author meta in shortcode?

I am trying to create a shortcode that will return a link to a book on Amazon with a specific affiliate tracking code specific to the author. I created a user option called "amz" to hold the author's ...
0
votes
2answers
142 views

Using multiple line variable inside a function?

I am using the commenting system to all users to add a private note that only they can see to posts and I am using the wordpress comments system to do it. I wrote a function to call the logged in user ...
0
votes
1answer
410 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
2answers
55 views

Shortcode of a function

I got this function and i want to make the contents divs of "foreach" as return. How can i do that? <?php $args = array( 'numberposts' => 6, ...
1
vote
1answer
2k views

Adding Shortcode to Text Widget

At the moment, I'm running WordPress v3.2.2 (soon to upgrade to v3.4.2), and am trying to insert shortcode to insert Issuu into a text widget on our sidebar. The WordPress plugin I installed and am ...
1
vote
1answer
190 views

How to display posts by current user in a drop down

I am trying to write a shortcode that works in conjunction with Contact Form 7 to display the current user that is logged in posts. I have been able to get it to work with regular posts using this ...
0
votes
1answer
142 views

Adding a Tag Parameter / Filter to My Shortcode

I have this plugin that displays category featured image thumbnails for each post via shortcodes.. like so, [categorythumbnaillist 3] (3 being the category of course) I would like it to only show ...
0
votes
1answer
490 views

AJAX function not working [closed]

One person on the site wrote a function, but I do not know why it works. This function displays a random quote. The functions implemented the ability to download new quotes via AJAX (link New Quote), ...
0
votes
2answers
145 views

Using locate-template & shortcodes doesn't appear to work

For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. ...
5
votes
2answers
768 views

Use AJAX in shortcode

I have the following code to the shortcode to display a random quote. Question: how to make a button display a new random quote? I mean, that would hit the button and show you a new quote (without ...
0
votes
2answers
1k views

Stripping shortcode from custom excerpt function

I'm using the following function to create a custom excerpt for my homepage and categories pages so I can do it by character count and have a custom "read more". However, I have captions shortcode ...
1
vote
1answer
269 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...