'GD > Features' widget shortcode available?
This topic contains 5 replies, has 3 voices, and was last updated by Giri 8 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: shortcode
-
AuthorPosts
-
April 12, 2016 at 8:06 pm #162204
Hi support,
I was hoping that there is a shortcode for the equivalent of the ‘GD > Features’ widget, is there one as I can’t find it on the core shortcodes doc page.
https://wpgeodirectory.com/docs/core-shortcodes/#listings
If there isn’t a shortcode for it, are there any plans to make it as I would like to show the Features on a page of its own in the main contents.
Thanks,
JoannaApril 13, 2016 at 4:02 pm #162629Hi,
no there isn’t at the moment. That widget has been created for a Theme that we will release soon and we never worked on the shortcode for it.
I’ve flagged this for the developers. They’ll add the shortcode to the next version.
Thanks for your patience,
April 13, 2016 at 4:16 pm #162636We don’t have any shortcode for that. But its very easy. So you can use html if this is very urgent for you
This is how code syntax look like
<ul class='gd-features'> <li> <h3 class='gd-fe-title'>Your title Goes here</h3> <div class='gd-fe-image'>img goes here</div> <div class='gd-fe-desc'>Description goes here</div> </li> </ul>
Just duplicate the
<li>....</li>
part, if you would like to add more items.
For image you can use normal image or font awesome icon.
Normal image
<ul class='gd-features'> <li> <h3 class='gd-fe-title'>Your title Goes here</h3> <div class='gd-fe-image'><img src="image url here" /></div> <div class='gd-fe-desc'>Description goes here</div> </li> </ul>
Font awesome icon.
<ul class='gd-features'> <li> <h3 class='gd-fe-title'>Your title Goes here</h3> <div class='gd-fe-image'><i style="color:#757575" class="fa fa-facebook"></i></div> <div class='gd-fe-desc'>Description goes here</div> </li> </ul>
April 13, 2016 at 4:19 pm #162640If you want that as a shortcode just follow these steps. Put the following code in your child theme’s functions.php file
function gd_features_custom_sc() { ?> <ul class='gd-features'> <li> <h3 class='gd-fe-title'>Your title Goes here</h3> <div class='gd-fe-image'>img goes here</div> <div class='gd-fe-desc'>Description goes here</div> </li> </ul> <?php } add_shortcode('gd_features_custom_sc', 'gd_features_custom_sc');
Then you can use shortcode like
[gd_features_custom_sc]
April 13, 2016 at 8:03 pm #162835Thank you very much! That worked for me.
I added the shortcut to my child theme functions.php file and tweaked it so I could get three in a row. Probably a bit of a hack but it worked!
Just in case its useful for everyone else, here’s the code structure I used:
function gd_features_custom_sc() { ?> <section id="geodir_features_widget-3" class="widget geodir-widget widget_gd_features"> <ul class="gd-features"> <li> <h3 class="gd-fe-title">Feature Title</h3> <div class="gd-fe-image"><i style="color:#1e73be" class="fa fa-star"></i></div> <div class="gd-fe-desc">The feature description goes here</div></li> <li> <h3 class="gd-fe-title">Feature Title</h3> <div class="gd-fe-image"><i style="color:#1e73be" class="fa fa-star"></i></div> <div class="gd-fe-desc">The feature description goes here</div></li> <li> <h3 class="gd-fe-title">Feature Title</h3> <div class="gd-fe-image"><i style="color:#1e73be" class="fa fa-star"></i></div> <div class="gd-fe-desc">The feature description goes here</div> </li> </ul> </section> <?php } add_shortcode('gd_features_custom_sc', 'gd_features_custom_sc');
April 14, 2016 at 12:25 pm #163266You are welcome 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket