Skip to content

Instantly share code, notes, and snippets.

View ssbalakumar's full-sized avatar
💭
I may be slow to respond.

Bala Kumar Sankarapandian ssbalakumar

💭
I may be slow to respond.
  • Wipro
  • Bengaluru, Karnataka, India
View GitHub Profile
@ssbalakumar
ssbalakumar / ACF Mega Menu.php
Created January 16, 2019 21:12
ACF Mega Menu
<?php
// check parent repeater
if( have_rows('parent_navigation_items', 'options') ):
echo '<ul class="nav primary-header-nav">';
// loop parent items
while ( have_rows('parent_navigation_items', 'options') ) : the_row();
echo '<li>';
@ssbalakumar
ssbalakumar / vc_link.php
Created December 13, 2018 07:08
Visual Composer Link sortcode and vc map / Anchor tag with visual composer
@ssbalakumar
ssbalakumar / Woocommerce Perfect SEO
Created May 5, 2018 10:53
Use Latest wordpress & woocommerce with Perfect SEO URL Plugin 2.6.7 The product-category not removed from 3.3.x woocommerce
Use Latest wordpress & woocommerce with Perfect SEO URL Plugin 2.6.7
The product-category not removed from 3.3.x woocommerce
Tricks here Credit - https://timersys.com/remove-product-category-slug-woocommerce/
------------
add_filter('request', function( $vars ) {
global $wpdb;
if( ! empty( $vars['pagename'] ) || ! empty( $vars['category_name'] ) || ! empty( $vars['name'] ) || ! empty( $vars['attachment'] ) ) {
$slug = ! empty( $vars['pagename'] ) ? $vars['pagename'] : ( ! empty( $vars['name'] ) ? $vars['name'] : ( !empty( $vars['category_name'] ) ? $vars['category_name'] : $vars['attachment'] ) );
$exists = $wpdb->get_var( $wpdb->prepare( "SELECT t.term_id FROM $wpdb->terms t LEFT JOIN $wpdb->term_taxonomy tt ON tt.term_id = t.term_id WHERE tt.taxonomy = 'product_cat' AND t.slug = %s" ,array( $slug )));
// Ref: https://www.elementcycles.net/
// Hide header on scroll down, show on scroll up
var did_scroll;
var last_scroll_top = 0;
var trigger_height = 5;
var navbar_height = $('.global-header').outerHeight();
$(window).scroll(function() {
did_scroll = true;
});
@ssbalakumar
ssbalakumar / Custom Post Type Jobs Careers
Created December 15, 2017 09:09
Custom Post Type Jobs Careers
// Custom Post Types
function wpt_job_post_type() {
$labels = array(
'name' => 'Vacancies',
'singular_name' => 'Job Opportunity',
'add_new' => 'Add New Job',
'add_new_item' => 'Add New Job Opportunity',
'edit_item' => 'Edit Job',
@ssbalakumar
ssbalakumar / post-type-metaboxes.php
Created December 13, 2017 06:31 — forked from devinsays/post-type-metaboxes.php
Example code shows how to register a post type and add basic metaboxes.
<?php
/**
* Example code for tutorial post on custom meta boxes:
* https://wptheming.com/2010/08/custom-metabox-for-post-type/
*/
/**
* Registers the event post type.
*/
function wpt_event_post_type() {
@ssbalakumar
ssbalakumar / job-application.php
Last active November 28, 2017 05:27
Job Application CF7
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>Post Applied For</label>
[select* post class:form-control "Operator" "Jr. Exe" "Sr. Exe" "Deputy Manager" "GM" "VP" "ASM" "ZSM" "DRSM" "SPO" "BDO" "BDM"]</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>Experience Year</label>
[text* exp-year class:form-control ]</div>
</div>
<div class="col-md-4">
@ssbalakumar
ssbalakumar / country-shortcode.php
Created November 27, 2017 12:10 — forked from MatthewEppelsheimer/country-shortcode.php
WP Contact Form 7 shortcode with list of Countries
<?php
/*
UPDATED: December 31, 2011.
Modifications:
- Truncated the longest country names, including:
-- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories
-- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands
@ssbalakumar
ssbalakumar / Wishlist
Created November 22, 2017 21:35
Wishlist Ajax
<header>
<a href="#>WISH LIST COUNT : <span>0</span></a>
</header>
// Button only without ajax loading GIF
<a href="http://yoursite.com/product/product-2/?add_to_wishlist=218" rel="nofollow" data-product-id="218" data-product-type="simple" class="add_to_wishlist">Add to Wishlist</a>
// Default wishlist button mark up
<div class="yith-wcwl-add-to-wishlist add-to-wishlist-218">
File size limit Htaccess:
-----------------------------------------
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Woocommerce Demo Content