Created
February 25, 2016 04:55
-
-
Save delowardev/8b286402f1781cb9d65f to your computer and use it in GitHub Desktop.
This file contains 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
<!--call css & js file--> | |
<?php | |
function theme_files(){ | |
//css | |
wp_enqueue_style( $handle, $src, $deps, $ver, $media ); | |
wp_enqueue_style( 'owl-theme', get_template_directory_uri().'/css/owl.theme.css', array(), '1.1', 'all' ); //example | |
//js | |
wp_enqueue_script('jquery'); //jquery | |
wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); | |
wp_enqueue_script( 'carousel', get_template_directory_uri().'/js/owl.carousel.js', array('jquery'), '2', true ); //example | |
} | |
add_action('wp_enqueue_script','theme_files'); | |
?> | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
<!--menu register--> | |
<?php | |
function theme_menus(){ | |
register_nav_menus( array( | |
'primery_menu' => 'Main Menu', | |
'footer_menu' => 'Footer Menu' | |
)); | |
} | |
add_action('init','theme_menus'); | |
?> | |
<!-- menu call --> | |
<?php | |
wp_nav_menu(array( | |
'theme_location' => 'header_menu' | |
)); | |
?> | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
<?php | |
//post thumb in theme | |
add_theme_support( 'post-thumbnails' ); | |
//img thumb size | |
add_image_size ( 'post_img', 280, 200,true ); | |
?> | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
<?php | |
//custom post register | |
function custom_theme_post(){ | |
register_post_type( 'teams', array( | |
'public' => true, | |
'labels' => array( | |
'name' => 'Teams', | |
'add_new_item' => 'Add New Member', | |
'edit_item' => 'Edit Team Member', | |
'all_items' => 'All Members', | |
'featured_image' => 'Member Photo', | |
'set_featured_image' => 'Set Member Photo', | |
'remove_featured_image' => 'Remove Member Photo' | |
), | |
'supports' => array('title','editor','thumbnail') | |
)); | |
} | |
add_action('init','custom_theme_post'); | |
?> | |
<!--custom post query--> | |
<?php | |
$welcome_text = new WP_Query( array ('post_type' => 'welcome_text', 'posts_per_page' => 1)); | |
?> | |
<!--custom post check & call --> | |
<?php if($welcome_text->have_posts()) : while($welcome_text->have_posts()) : $welcome_text->the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php the_excerpt(); ?> | |
<?php endwhile; endif; ?> | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
<?php | |
//short code | |
function col_shortcode($atts, $content = null){ | |
extract(shortcode_atts( array( | |
'col' => '12' | |
), $atts )); | |
return '<div class="col-md-'.$col.' col-xs-12">'. do_shortcode($content) .'</div>'; | |
} | |
add_shortcode( 'col', 'col_shortcode' ); | |
?> | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
<?php | |
//option tree | |
add_filter( 'ot_theme_mode', '__return_true' ); | |
add_filter( 'ot_show_pages', '__return_false' ); | |
require( trailingslashit( get_template_directory() ) . 'option-tree/ot-loader.php' ); | |
include_once('inc/theme-options.php'); | |
include_once('inc/meta-boxes.php'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment