Articles of shortcode

Add shortcode within the_content()

I’m trying to add a shortcode within the text of the_content(). It is possible to add it to the beginning or the end however I cannot figure out how I would get it to show after say 200 characters. Here’s the shortcode that I need added: [related-posts] I’ve tried this but this isnt suitable for […]

Form Plugin for Api Requests which is used via Shortcode

I’ve a little PHP Script with a input Form which is used to register for a newsletter. This Form accepts only an email address and then makes an api call using curl. Now I wan’t to build this form as a plugin for wordpress. It should be easy usable on different pages with a shortcode. […]

Form processing: How to process form before output and access data from shortcode

I have a form that’s output with a shortcode. I need to be able to conditionally process a redirect on the form submission, so the form processing needs to happen before any output is sent (I’ve put it on the init hook). What’s the best way for me to access the form validation’s status ($validate) […]

Custom user registration shortcode – redirect header issue

I’ve created a custom shortcode that calls a function which will produce a registration page. Registration works. No issue here. The issue I am having is to log the user in after a successful registration. I understand the reason I am getting header already sent error is because the shortcode is loaded after the header […]

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 do_shortcode() isn’t available: Why might a plugin's 'do_shortcode' not work in an AJAX request? But I’m afraid I can’t for the life of me figure out if […]

Sanitize or treatment of string in editor via shortcode

I have a string of data that’s getting passed to the page via shortcode, but the original developer of the shortcode did not account for how I’m necessarily planning on using the data on the page, unfortunately. I’m creating a “leaving this website” type of page, and the user will be presented with a message, […]

Which wordpress function is the caption shortcode linked to?

I have used this code in my page content to try and output an image + caption with a custom caption class and id… …but the caption’s id and class names are not being output. After some digging around, I found the img_caption_shortcode function in wp-includes/media.php which handles the id and class attributes of the […]

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 there is a way for the URL part of the code to take “United States” and turn it into “United-States.gif” since “United […]

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 are screencaps of different TV episodes, including the commercials. However, I don’t want the commercials’ […]

Image and shortcode not showing in excerpt

I’ve paid to someone to create a theme for me. Everything works fine, except the excerpt on category posts. It only shows an excerpt of the post ( not image ) and when I add a shortcode in the excerpt, it show this as text and doesn’t compile it When I go to full post, […]