Instantly share code, notes, and snippets.
Product and Engineering @CleverXHQ
-
18:52
(UTC -07:00) - https://cleverx.com
- @vsachn
- in/verma-sachin
vermasachin
/ Call Sidebar On Homepage
Last active
January 4, 2016 18:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('get_header','bitdoz_custom_homepage_sidebar'); | |
| function bitdoz_custom_homepage_sidebar() { | |
| if ( is_front_page() ) { | |
| remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
| add_action( 'genesis_sidebar', 'bitdoz_do_sidebar' ); | |
| } | |
| } | |
| function bitdoz_do_sidebar() { | |
| genesis_widget_area( 'custom-homepage-sidebar' ); |
vermasachin
/ Registering New Sidebar
Last active
January 4, 2016 18:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Register new sidebar | |
| genesis_register_sidebar( array( | |
| 'id' => 'custom-homepage-sidebar', | |
| 'name' => 'Custom Homepage Sidebar', | |
| 'description' => 'This is the sidebar for Homepage', | |
| ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /************** | |
| Custom Social Share Buttons | |
| ***************/ | |
| .social-sharer{ | |
| display: table; | |
| } | |
| .share-love | |
| { | |
| float:left; | |
| width: 100px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (is_single() ) { ?> | |
| <div class="social-sharer"> | |
| <div class="share-love"> | |
| <center><div class="share-text"><i class="icon-share"></i> Share it!</div></center> | |
| </div> | |
| <div class="share-facebook"> | |
| <center><a href="http://www.facebook.com/share.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>" target="_blank"><div class="share-text"><i class="icon-facebook"></i> Share on Facebook</div></a> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <i class="icon-facebook"></i> | |
| <i class="icon-twitter"></i> | |
| <i class="icon-google-plus"></i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://plus.google.com/share?url=<?php print(urlencode(get_permalink())); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://twitter.com/home?status=<?php print(urlencode(the_title())); ?>+<?php print(urlencode(get_permalink())); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://www.facebook.com/share.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php print(urlencode(get_permalink())); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php print(urlencode(the_title())); ?> |