Elementor says - "Sorry, the content area was not found in your page. " while using custom shortcode - wordpress

I am using default theme of Elementor Plugin. Plugin is very nice but I am facing issue while using my custom shortcode in page. It shows “Sorry, the content area was not found in your page. You must call
the_content function in the current template, in order for Elementor to work on this page.”
[1]: https://i.stack.imgur.com/7xBHV.png
To solve this error, I have added <?php the_content(); ?> in my custom shortcode but it shows the same error.
I have also tried by creating a custom template, but the result is same.
So please help me to solve this error. Any suggestions are acceptable.
Thanks in Advance

Probably your shortcode function changes the post query.
try adding wp_reset_query(); before the function closes.

Related

Elementor on Wordpress not loading due to

I'm still pretty new to Wordpress but I started rebuilding a website and I want to edit the homepage elements.
Unfortunately when i click on "edit with Elementor" i get this error:
can anyone help me please?
I want to edit my header search bar and re-order the elements in this homepage...
Can you please check the page code if
<?php echo the_content();?>
is added in your page code?

Woocommerce best_selling_products shortcode not working

Trying to add:
<?php echo do_shortcode('[products best_selling="true" limit="4"]'); ?>
In a template returns nothing. I see that no hooks are present for this but woocommerce says it should be supported.
Please Try this shortcode
[best_selling_products per_page="12"]
Please refer below link for Woocommerce Shortcodes
https://docs.woocommerce.com/document/woocommerce-shortcodes/
Coming back to this one because I came across another shortcode that wasn't working.
It turned out that the theme was the culprit. After switching to the default theme all shortcodes were working correctly.

do shortcode not working for Advanced post slider

I've been stuck on this for a while. I'm working on a wordpress site.
I'm trying to use a Advanced post slider plugin, but calling it in a template via
echo do_shortcode('[advps-slideshow optset="1"]'); //just isn't working.
But it is working when directly pasted [advps-slideshow optset="1"] in wordpress page.
Any help would be greatly appreciated.
Advanced post slider looks to be working my end with the code you provided. What happens if you do <?php print_r(do_shortcode('[advps-slideshow optset="1"]')); ?> are you also getting any js errors in your console log?
the problem seems to be in the plugin itself, as I see no errors in the string you wrote. I think you should write the developers with this issue. you may suggest you another slider plugin with shortcodes for WP post galleries- freemake slider. on you blog it works well. the archive can be loaded from here http://www.freemake.com/free_wordpress_slider_plugin/

Opening Wordpress Gallery from a link

Is it possible to open a wordpress gallery using an anchor tag so that the gallery appears on the same page in a lightbox? I cannot figure out how to do so. It seems like it should be such a simple thing to do but I have tried various plug ins and cannot work out a simple solution.
first, install this plugin
https://wordpress.org/plugins/anything-popup/
Then go to setting->anthing-pop there will be a shortcode http://awesomescreenshot.com/03561dd759
then click to edit it and put the [galley] shortcode
http://awesomescreenshot.com/09261ddfc0
http://awesomescreenshot.com/0ae61ddmb5
Now use the shortcode on click see screenshot
http://awesomescreenshot.com/0de61dej39
you can use the shortcode into post or page or in file like this
<?php echo do_shortcode('[AnythingPopup id="1"]'); ?>
thanks

Wordpress plugin shortscodes in other plugins?

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

Resources