Skip to content

Instantly share code, notes, and snippets.

View jitenbharadava's full-sized avatar

Jiten jitenbharadava

  • Rajkot
View GitHub Profile
@jitenbharadava
jitenbharadava / funcation.php
Created October 17, 2015 11:48
Taxonomy category shortcode
<?php // Taxonomy category shortcode
function cat_func($atts) {
extract(shortcode_atts(array(
'class_name' => 'cat-post',
'totalposts' => '-1',
'category' => '',
'thumbnail' => 'false',
'excerpt' => 'true',
'orderby' => 'post_date'
), $atts));
@jitenbharadava
jitenbharadava / country.php
Last active October 17, 2015 11:38
Terms location serach
<?php
function print_show_location( $terms = '' ){
// check input
if ( empty( $terms ) || is_wp_error( $terms ) || ! is_array( $terms ) )
return;
// set id variables to 0 for easy check
$country_id = $state_id = $city_id = 0;
@jitenbharadava
jitenbharadava / admin-event.php
Created October 17, 2015 11:33
Custome Post type event
<?php
add_action('init', 'review_register');
function review_register() {
$labels = array(
'name' => _x('Event', 'Event'),
'singular_name' => _x('Event', 'Event'),
'add_new' => _x('Add New Event', 'Event'),
@jitenbharadava
jitenbharadava / main.php
Last active October 17, 2015 11:43
Slider Gallery shortcode wordpress
<?php
function gallery_list( $atts, $content = null ) {
extract(shortcode_atts(array('class' => ''), $atts));
if ( function_exists( 'ot_get_option' ) ) {
/* get the slider array */
$slides = ot_get_option( 'FILEDNAME', array() );
@jitenbharadava
jitenbharadava / gist:e0503c4508ee136f09ce
Last active October 17, 2015 11:27
Wordpress Funcation like Plugins, Themes, Site Home, WordPress, Multisite
Plugins
plugins_url()
plugin_dir_url()
plugin_dir_path()
plugin_basename()
Themes
get_template_directory_uri()
get_stylesheet_directory_uri()
get_stylesheet_uri()