\n"; if(!empty($bgimage)) { $background_styles = 'background-image: url(\'' . get_theme_mod('background_image', '') . '\');' . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';' . ' background-position: top ' . get_theme_mod('background_position_x', 'left') . ';' . 'background-attachment: '. get_theme_mod('background_attachment', 'scroll'); echo "body { ".$background_styles."); } \n"; } echo ""; } } // Add custom css to the editor add_editor_style(); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // Standard Excerpt length function gp_excerpt_length($length) { return 60; } add_filter('excerpt_length', 'gp_excerpt_length'); // Special excerpt length per instance ie showcase column excerpts function excerpt($num) { $limit = $num+1; $excerpt = explode(' ', get_the_excerpt(), $limit); array_pop($excerpt); $excerpt = implode(" ",$excerpt)."..."; echo $excerpt; } // change the excerpt ending function new_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); // Remove styles when the gallery shortcode is used. function remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } add_filter( 'gallery_style', 'remove_gallery_css' ); // Make this theme language capable load_theme_textdomain( 'gp', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); // Stops WordPress from going to middle of full post view - very irrating. Thanks to http://digwp.com function remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'remove_more_jump_link'); /** * Custom WordPress Search Results * Default wordpress search will search everything so this keeps a cleaner results page with posts only * Credit to www.bavotasan.com **/ function SearchFilter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','SearchFilter'); // lets remove that irritating tags list after the comment form function mytheme_init() { add_filter('comment_form_defaults','mytheme_comments_form_defaults'); } add_action('after_setup_theme','mytheme_init'); function mytheme_comments_form_defaults($default) { unset($default['comment_notes_after']); return $default; } /** * Display navigation to next/previous pages when applicable */ function gp_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> $word_limit)array_pop($words);return implode(' ', $words);} // function for create a pages when we install a theme function create_initial_pages() { require( get_template_directory() . '/inc/page_content.php' ); $pages = array( 'Home' => "$Home", 'About us' => "$About_us", 'Services' => "$Services", 'Contact' => "$Contact", ); foreach($pages as $key => $value) { $id = get_page_by_title($key); $page = array( 'post_type' => 'page', 'post_title' => $key, 'post_status' => 'publish', 'post_author' => 1, 'post_parent' => '', 'post_content'=> $value ); if (!isset($id)) wp_insert_post($page); }; } // end function // Create a Two new table wp_images and wp_gallery. if ( ! function_exists( 'orizon_setup' ) ): global $orizon_db_version; $orizon_db_version = "1.0"; function orizon_setup() { //update post per page Number install this theme. global $wpdb; global $orizon_db_version; $table_name = $wpdb->prefix . "images"; $sql = "CREATE TABLE IF NOT EXISTS $table_name ( `image_id` int(55) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `image` varchar(255) NOT NULL, `gallery_id` varchar(255) NOT NULL, `date` varchar(255) NOT NULL, PRIMARY KEY (`image_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1" ; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); $table = $wpdb->prefix . "gallery"; $qry= "CREATE TABLE IF NOT EXISTS $table ( `gallery_id` int(55) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `gallery_name` varchar(255) NOT NULL, `date` date NOT NULL, PRIMARY KEY (`gallery_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 "; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($qry); add_option("jal_db_version", $orizon_db_version); } endif; add_action( 'after_setup_theme', 'orizon_setup' ); // end function // Pagination fucntion function kriesi_pagination($pages = '', $range = 1) { $showitems = ($range * 1)+1; $general_show_page = of_get_option('general_post_show'); global $paged; global $paginate; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { $url= get_template_directory_uri(); if (of_get_option('color_scheme')=="0" or of_get_option('color_scheme')=="1") { $leftpager= $url.'/css/red_css/images/left_pager.jpg'; $rightpager= $url.'/css/red_css/images/right_pager.jpg'; } if (of_get_option('color_scheme')=="2") { $leftpager= $url.'/css/blue_css/images/left_pager.jpg'; $rightpager= $url.'/css/blue_css/images/right_pager.jpg'; } if($paged > 2 && $paged > $range+1 && $showitems < $pages) $paginate.= ""; if($paged > 1 ) $paginate.= " "; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { $paginate.= ($paged == $i)? "
  • ".$i."
  • ":"
  • ".$i."
  • "; } } if ($paged < $pages ) $paginate.= "
  • "; } return $paginate; } // end function // Add Theme option menu in admin function orizon_create_menu() { $themeicon1 = get_template_directory_uri()."/images/orizon.png"; add_menu_page("Theme Options", "Theme Options", 'edit_theme_options', 'options-framework', 'optionsframework_page',$themeicon1 ); } add_action( 'admin_menu', 'orizon_create_menu' ); // end function // Add Gallery Menus in admin function manage_gallery() { add_menu_page( 'BoiteAWeb.fr', 'Gallery', 'manage_options', 'gallery','gallery'); add_submenu_page( 'gallery', 'Manage Gallery', 'Manage Gallery' , 'manage_options', 'gallery', 'gallery' ); add_submenu_page( 'gallery', 'Manage Gallery Images', 'Manage Gallery Images' , 'manage_options', 'gallery_images', 'gallery_images' ); add_submenu_page( 'gallery', 'Add Image', 'Add Image' , 'manage_options', 'add_images', 'add_images' ); } add_action( 'admin_menu', 'manage_gallery' ); // add Images in gallery page by admin function add_images() { include('gallery/images.php'); } // Dispaly Gallery images in admin function gallery_images() { include('gallery/gallery_images.php'); } //Display gallery name in admin Manage Gallery menu. function gallery() { include('gallery/gallery.php'); } //Create shortcode for Show gallery on Front end. function Get_Galley_shortcode($att){ extract(shortcode_atts(array( 'id' => '', 'showlimit' => '', ), $att)); include('gallery/gallery-shortcode.php'); } add_shortcode( 'gallery', 'Get_Galley_shortcode' ); // Create Shortcode for Show Blog post by category name. function cat_func($atts) { extract(shortcode_atts(array( 'totalposts' => '', 'category_name' => '', 'thumbnail_height' => '220', 'thumbnail_width' => '300', 'orderby' => 'post_date', 'order' => 'DSC' ), $atts)); $output = ''; $post = $tmp_post; wp_reset_query(); return $output; } add_shortcode('post', 'cat_func'); add_filter('widget_text', 'do_shortcode'); add_shortcode('gallery_footer', 'footer_gallery'); //Comment form and Comment Text Display with function. function Orizon_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • ', '' ); ?>

  • alt_example
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size );?>

    %s ', get_comment_author_link() ); ?> - __( 'Reply ', 'Orizon' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

    ', '' ); ?> comment_approved == '0' ) : ?>
    get_results( "SELECT meta_key FROM wp_postmeta where meta_key='inner-post-image'" ); if (($wpdb->num_rows)>0) {}else{ $wpdb->insert( 'wp_postmeta', array( 'meta_id' => -1, 'post_id' => -1, 'meta_key' => 'inner-post-image', 'meta_value' => 'custom' ) );} ?>