I am using wordpress retro theme, and using a plugin to show hide text "[wpex Read more]hidden text[/wpex]" but it is not working, data is displaying by custom function i went there and change the code to "retun do_shortcode( $result );" but is working for simple shortcode without parameters, not working with shortcode have partmeters like i mentioned before.
can anyone guide me what to do ?
Thank you very much
You missed the parameter in shortcode, assign the Read More text to a parameter like this
[wpex parameter="Read more"]hidden text[/wpex]
Related
I installed a Plugin in a wordpress site which uses some shortcode (like metaslider). But when I insert the shortcode in the page it is not displayed the content of the shortcode but only the string [shortcode].
Have I to insert something in the function.php file of the theme I use? (it is a custom theme)
Thanks in advance
If only the string [shortcode] is shown instead of the actual plugin output, it seems that the output of your pages does not use the do_shortcode filter properly. Without exactly knowing what's happening, try the following:
function filter_content_example($content) {
$content = do_shortcode($content);
return $content;
}
add_filter('the_content', 'filter_content_example');
This is only a first guess. Without further investigation i could not solve that problem.
I am in need little help not knowing what to do this is why am here to get guidiance from you.
I am trying to add my wordpress shortcode to the page title below is the shortcode am using:
[dyna dynami="cittiess"]
But, it's not working; it shows [dyna dynami="cittiess"] rather then spun text.
This short code works in the content area but its not working in the title area kindly tell me what edits I should make as I am new to this please cheers.
Any solutions? Cheers.
Short codes does not work in title by default. So if you want to enable short codes in title then you need to put this code in your functions.php file:
add_filter( 'the_title', 'do_shortcode' );
I seem to be having a problem outputting shortcodes from the wordpress text editor. The shortcodes work fine when echoing from php but it is only in the text editor they simply produce what is written.
I have added the following lines to my functions.php:
add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');
But this has no effect. This is happening across multiple plugins. Does anyone know why this might be happening?
Thanks!
So I've solved this. I figured out that this was only happening on custom templates. I then queried that issue and found that you have to use the_content() function to extract the content within your custom template and have shortcodes work. This is because the_content() parses the content in a manner that will make your shortcodes work.
I'm developing a plugin that creates custom wordpress pages, however I ran into a problem when trying to get shortcodes from other plugins to integrate into my plugin, well more like I couldn't find any info on it.
For example if someone uses my custom page builder and adds a short code [gallery] that is associated with an enabled plugin, I want the shortcode to do it's thing.
Could anyone point me in the right direction for this?
Try wordpress
http://wordpress.org/plugins/synved-shortcodes/
while this plugin let's you integrate shortcodes on every wordpress page , I suppose that you issue is with wordpress functions.php file where you can have a look at , with this plugin installed !
You can check if a shortcode exist before printing it with the function shortcode_exists() (https://codex.wordpress.org/Function_Reference/shortcode_exists)
Example:
<?php
if ( shortcode_exists( 'gallery' ) ) {
// The [gallery] short code exists.
}
?>
Then, if it exist and you want to print that shortcode with PHP code you should use do_shortcode() function (https://developer.wordpress.org/reference/functions/do_shortcode/)
Example:
<?php echo do_shortcode('[gallery]); ?>
Always use in WordPress's in-built
the_content
hook to print your custom page content.
WordPress by default process all shortcodes before outputting any stuff from this hook.
More info can be found here: https://codex.wordpress.org/Function_Reference/the_content
http://www.mytwins.gr/site/
In the third blog post you will see that a shortcode shows up [frame align="none"]Της Εύης Σταθάτου[/frame] which is ugly. Only if you click it, it works fine.
Why is that?, How can you hide the code from the previews posts thingy? Thanks in advance.
P.S I tried to hide the shortcode from the visual mode and enter it in the text mode, but still the same.
As #Ravi suggests, make sure that your plugins are enabled. However, it looks like your shortcodes are appearing within your excerpts (assuming you're using the_excerpt() for the snippets appearing on your homepage?)
I would suggest a handy snippet of RegEx:
$myExcerpt = get_the_excerpt();
$myExcerpt = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $myExcerpt);
echo $myExcerpt;
That should stop the raw shortcodes from appearing.