do shortcode not working for Advanced post slider - wordpress

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/

Related

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

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.

content area not found in my page with elementor

I just started with Wordpress and I published a website a few weeks ago. Today I wanted to edit the homepage, but I get the following error:
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.
I haven't edited my homepage and it worked perfectly a couple of weeks ago. Is there someone that can help me fix this issue?
If you are using any shortcode on your page and you are fetching post on that page and looping through the post in a while loop. Please add this after the loop ends. No sure why but this always cause issue for me.
wp_reset_postdata();
Code will look like this:
$posts= new WP_Query($args);
while ($posts->have_posts() ) : $posts->the_post();
.....
.....
.....
endwhile;
wp_reset_postdata();
It doesn't matter it's a shortcode or what if we are doing something like above make sure to add wp_reset_postdata();
This is one of the issues that I usually face. There can be other reasons too.
Probably you've edited the page template from Templates -> Theme Builder -> Single. Anyway, even if you don't, you can fix it that way: Go to Templates -> Theme Builder -> Single -> Add New, then select page and create a template for all single pages (make sure that you drag the page content widget in the template). This should overwrite your theme single page template (which misses the content function).
Just make sure your 'Home Page' and 'Posts Page' are different, otherwise you get your page mixed up and this error occurs.. Worked for me!
You can verify this setting in Appearance>Customize>Homepage Settings :)
The Answer to this error is to check the structure of your permalinks. Try to save your permalinks one more time. Also, try to change the permalink structure to “Plain”. Some servers do not allow to write to the .htaccess file and as a matter of fact, you cannot always modify your permalink structure and edit with Elementor.
I found myself in the same place yesterday and freaked for a moment and did some research to find out why I was receiving the error and came across this page. Believe for me it occurred due to the situation Ed Jones posted about above, I had inadvertently edited the post template. But a fast and easy fix was to go back to an earlier revision of the page in my history. That solved my problem quickly.
Add the_content() at the end of your templates

How to get do_shortcode() to stop stripping contents of a shortcode?

I have wp job manager installed and i have echo do_shortcode( '[jobs]' ); in side a custom template but for some unknown reason the shortcode won't output the required results of the [jobs] shortcode.
But when i use the shortcode in the wp editor it works fine, i have been at this for hours and cant seem to find a solution tot his problem any where.
If you have encountered this issue before please advise me how you fixed it.
Thanks in advance
In my case i had a javacript error in the browser console that's why do_shortcode() was not working correctly. I hope this helps someone else

woocommerce theme development without shortcodes

I was wondering if someone could help me out. I am developing a theme that uses woocommerce as the ecommerce solution. I know that there are predefined shortcodes that you can use but i was wondering if there was a way to actually implement woocommerce items in my php code as opposed to using shortcodes.
Thanks,
Try this:
https://wordpress.stackexchange.com/a/125286/60175
<?php echo do_shortcode('[product_page id="31"]'); ?>
And at the Shortcodes doc, I see
To find the Product ID, go to the Product > Edit screen and look in the URL for the postid= as shown below.
http://docs.woothemes.com/document/woocommerce-shortcodes/
Of course this still uses shortcodes (pretty slick), but in your PHP. The Wordpress framework must be available in your PHP page, which I think you do by including wp-load.php at the beginning.

facebook comments with wordpress not working

I've a wordpress blog for my website and added facebook comment for that. It shows the option to enter the comment using facebook account. But that doesn't show the comments from users.
Any idea about that will be really helpful.
try this plugin
facebook-comments-for-wordpress.3.1.3
only you have to write the following shortcode wherever you want comments to be displayed:
<?php if (function_exists('facebook_comments')) facebook_comments(); ?>
I have implemented it and it works fine.

Resources