What I want to do is make my Home Page. I can do it this way:
Create a page and insert my gallery from plugin with that code [wonderplugin_gridgallery id=1]
Set that page as HomePage.
BUT THAT IS NOT WORKING. When I add this code [wonderplugin_gridgallery id=1]
to my page, I can see only code… The same doesn't work <?php echo do_shortcode('[wonderplugin_gridgallery id=1]'); ?>
(hidden).
How to fix it? I don't know how to find the file to fix in FTP. Themes Virtue.
I hope you understand what I am writing about. Thank you in advance.
What I want to do is make my Home Page. I can do it this way:
Create a page and insert my gallery from plugin with that code [wonderplugin_gridgallery id=1]
Set that page as HomePage.
BUT THAT IS NOT WORKING. When I add this code [wonderplugin_gridgallery id=1]
to my page, I can see only code… The same doesn't work <?php echo do_shortcode('[wonderplugin_gridgallery id=1]'); ?>
(hidden).
How to fix it? I don't know how to find the file to fix in FTP. Themes Virtue.
I hope you understand what I am writing about. Thank you in advance.
Depending on what post editor you are using:
If you add the shortcode manually to the file, make sure it's before the closing PHP tag: ?>
If you have the following code in your template:
<?php $post_id_286 = get_post( 286 ); echo $post_id_286->post_content; ?>
then you should can the do_shortcode
function to process shortcodes. Do it like this:
<?php $post_id_286 = get_post( 286 ); echo do_shortcode($post_id_286->post_content); ?>
This helped in my case. Hope it will help you too.
<?php $post_id_286 = get_post( 286 ); echo $post_id_286->post_content; ?>
this is for the main page (homepage). It turned out there does not work shortcode. The post works, the main page is not. You understand? – Sergey Kiziev Commented Dec 29, 2018 at 10:06the_content()
function, the attached filters are what properly process the output to make shortcodes work. – Milo Commented Dec 29, 2018 at 16:25