Insert in php?
-
Hi and thanks for this great plugin.
Is there a way to use the shortcode inside php files for better positioning?
-
Hi Manux_oS,
In practical terms this can be done with the following code:
echo do_shortcode('[gridwud slug="your-slug"]');Just see that you include this inside a <div> to avoid lay-out problems:
<div style="width:xxx; ... ; ..."> echo do_shortcode('[gridwud slug="your-slug"]'); </div>Let me know the results!
Regards, DannyThis is a better sample:
if (function_exists('grid_wud_funcs')) { echo '<div style="type-here-css-values">'; echo do_shortcode('[gridwud slug="type-here-your-slug"]'); echo '</div>'; }This will check or Grid WUD is active and if yes it displays the grids.
Change : “type-here-css-values” in real CSS values.
Change : “type-here-your-slug” in a real slug.If you disable the Grid WUD plugin, it will not be displayed.
Regards, Danny
Thanks for your support,
For a start i tried the following:
<div class="wud"> <?php echo do_shortcode('[gridwud slug="smartphone" button="1"]'); ?> </div>Worked nice! You can check here: TechValue.gr
Is there any way to control the height?
.wud { clear: both; margin: auto; max-width: 960px; padding-top: 10px; text-align: center; }Thanks π
I took a screenshot for you to check your cool plugin in action:
https://techvalue.gr/wp-content/uploads/2016/08/wud.jpg
I had to remove the code, it’s a live site.
Hi Manux_oS,
If you can provide me an URL from a page/post where i can see Grid WUD in action, i can help you with your height question.
Regards, DannyThanks so much Danny,
You can have a look now. TechValue.gr
Let me know if you need any help testing etc
Your welcome Manux_oS,, but can you provide me an URL where Grid WUD is in action?
On your front page is nothing to see with Grid WUD.
Regards, DannySorry Danny, had to disable it again for some time, you can have a look now.
Clean your cache if you don’t see it.
Thanks
It’s ok i managed to control the height.
Thanks for your time
Hi Manos,
I’ve seen now the grids on top of your page and it looks great!
Your site rocks π
Regards, DannyHey Danny,
Thanks π
It’s not done yet π I will need your support again! I have also complete the contact form in your website!
Here is my code if someone wants to show it only at home page:
<div class="wud"> <?php if( is_front_page()) : ?> <?php echo do_shortcode('[gridwud slug="smartphone" button="1"]'); ?> <?php endif;?> </div>Hey Manos,
The contact form we are using is: Clean and Simple Contact Form.
And the security is reCAPTCHA from Google.
For those who want to see this in action, click HERE
.
Regards, DannyHey Manos,
Your code seems to be okΓ© π
You can simplify it like this:<div class="wud"> <?php if( is_front_page() || ishome()) : echo do_shortcode('[gridwud slug="smartphone" button="1"]'); endif; ?> </div>I have added the ishome() check.
is_front_page() returns true if the user is on the page or page of posts that is set to the front page on Settings->Reading->Front page displays
is_home() return true when on the posts list page, This is usually the page that shows the latest 10 posts.
(explained here)
And for NOW … i go to start and enjoy my weekend π
Regards, Danny
Thanks Danny, for sure you have to go and enjoy the weekend!
The topic ‘Insert in php?’ is closed to new replies.