Code Snippets

The quickest way to use this section is to search using a search term.

Have you contributed your favorite snippets yet? Check your submissions using the link attached to your welcome message in the header.

Snippets include php, javascript or css code to help customise your site. If you wish to add some helpful bits of code you can submit it here for review. All contributions welcome!

Language:           Keyword:             
Hyperlink Featured List Item
Place the following code in your page's Custom Javascript area and make sure you add my class to the specific featured list item that you will want to link.
See this code in use here: 
Submitted by: distillerycreative
Language: JavaScript

Add Custom Post Type to the Recent Posts Element in Cornerstone
Add this in your child theme functions.php file.
See this code in use here: 
Submitted by: Donald McGuinn
Language: PHP

How to add terms and conditions checkbox for email form extension
You have to add in /wp-content/plugins/x-email-mailchimp/email-integration/views/site/shortcode-x-suscribe.php in line 185:
See this code in use here: 
Submitted by: delerean
Language: PHP

Add a Slider Above Blog
This is for the integrity stack.
See this code in use here: 
Submitted by: XAdmin
Language: PHP

Blog in Breadcrumb Trail
For Posts, when using a breadcrumb trail and clicking on tags, categories - all you see is "Home" > Tag or Category Name. The following snippet will allow you to see -: Home > Blog > Tag or Category Name. Where "Blog" upon click will drive you back to the Blog url. Use a child theme and add this to your functions.php file. Please note -: a freshly created PHP will need RED. The crux of the add is " $blog_home_url . $delimiter . " wherever you see an appropriate (post,tag) echo statement.
See this code in use here: 
Submitted by: shamrockoz
Language: PHP

Show Today’s Date with a Shortcode
Put this in your child theme's functions.php file.
See this code in use here: 
Submitted by: XAdmin
Language: PHP

Show Mobile Menu Sooner
This will hide the desktop site and show the mobile menu button. This is particularly great for sites with more links in their navigation menu so it does not go to a second row.
See this code in use here: 
Submitted by: XAdmin
Language: CSS

Social Buttons twist – Remove the Tooltip Hover Over and Border Lines
Social Buttons - Remove the Tooltip Hover Over By default, your social buttons will have a Tooltip hover over when someone hovers each button. Easily remove it by adding the following CSS:
See this code in use here: 
Submitted by: gorgonzola73
Language: CSS

Image Behind NavBar
See this code in use here: 
Submitted by: XAdmin
Language: CSS

Add parallax to all devices (touch or non-touch enabled)
You will need to add this script after the cornerstone-site-body script gets enqueued Use "cornerstone-site-body" as a dependency when registering via wp_register_script/wp_enqueue_script For reference: https://community.theme.co/forums/topic/parallax-not-working-in-chrome-and-windows-8/#post-1194968
See this code in use here: 
Submitted by: Mike
Language: JavaScript