Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / change-search-form.php
Last active Apr 7, 2019
Add Search Toggle at End of Menu
View change-search-form.php
<?php //<~ don't add me in
add_filter( 'get_search_form', 'wpb_alter_search_form', 20 );
// Modify Search Form
function wpb_alter_search_form( $form ){
return '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
<input type="search" name="s" placeholder="SEARCH..." value/>
</form>';
}
@neilgee
neilgee / isotope-init.js
Last active Mar 19, 2019
Isotope Filter Custom Taxonomy on CPT Archive Page
View isotope-init.js
jQuery(document).ready(function($){
var $grid = $('.grid').isotope({
itemSelector: '.grid-item',
percentPosition: true,
layoutMode: 'fitRows',
});
// Layout Isotope after each image loads
$grid.imagesLoaded().progress( function() {
@neilgee
neilgee / custom-tax.php
Last active Mar 19, 2019
Output a Custom Taxonomy Loop of Terms
View custom-tax.php
<?php
// Taxonomy Loop
/**
* Get the Custom Taxonomy
* For a list of other parameters to pass in see link below
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
* For a list of get_term return values see link below
* @link https://codex.wordpress.org/Function_Reference/get_term
@neilgee
neilgee / login-out.php
Last active Mar 15, 2019
Login/Logout Shortcode
View login-out.php
<?php //<~ remove if using in functions.php
add_shortcode( 'login_logut', 'login_logut' );
/**
* Add a login/logout shortcode button
* @since 1.0.0
*/
function login_logut() {
ob_start();
if (is_user_logged_in()) :
@neilgee
neilgee / veno-ftg.js
Created Feb 24, 2019
Venobox Ajax Reload on Callback for Final Tiles Gallery
View veno-ftg.js
(function($){
$(function() {
// Detects the end of an ajax request being made for Final Tiles GAllery
$(window).load(function() {
$('.final-tiles-gallery').finalTilesGallery({
onLoading: function () {
//console.log("Gallery is loading new images");
@neilgee
neilgee / pc-menu.js
Last active Apr 10, 2019
WooCommerce Accordion Style Expand/Collapse Product Category Menu
View pc-menu.js
jQuery(document).ready(function($) {
/**
* WooCommerce Product Category Accordion jQuery Menu
* @link https://wpbeaches.com/woocommerce-accordion-style-expand-collapse-product-category-menu/
*/
if ($('ul.product-categories').length > 0) {
// Set variables
@neilgee
neilgee / after.php
Created Jan 5, 2019
Beaver After Set Up Theme
View after.php
<?php // <~ don't add me in
add_action( 'after_setup_theme', 'bt_theme_setup', 15 );
/**
* Beavertron theme set up
*
* @since 1.0.0
*/
function bt_theme_setup() {
@neilgee
neilgee / overlay.css
Last active Jan 3, 2019
Beaver Themer Sticky Header Overlay Flyout
View overlay.css
/* # Overlay
---------------------------------------------------------------------------------------------------- */
.admin-bar .overlay {
top: 150px; /* Header + admin bar - in this case 128px + 32px */
}
/* See the Overlay in BB editing mode */
.fl-theme-layout-template-default .overlay {
@neilgee
neilgee / cart-add-menu.php
Last active Dec 15, 2018
WooCommerce Cart Icon
View cart-add-menu.php
<?php // <~ don't add me in
add_filter( 'wp_nav_menu_top-menu_items', 'woo_cart_but_icon', 10, 2 ); // Change menu to suit - example uses 'top-menu'
/**
* Add WooCommerce Cart Menu Item Shortcode to particular menu
*/
function woo_cart_but_icon ( $items, $args ) {
$items .= '[woo_cart_but]'; // Adding the created Icon via the shortcode already created
@neilgee
neilgee / themer-header.js
Last active Jan 2, 2019
FLThemeBuilderHeaderLayout Override Shrink/Stick
View themer-header.js
(function($){
/**
* Helper class for header layout logic.
*
* @since 1.0
* @class FLThemeBuilderHeaderLayout
*/
FLThemeBuilderHeaderLayout = {
You can’t perform that action at this time.