giasi 8 ارسال شده در خرداد 92 گزارش بازنشر ارسال شده در خرداد 92 (ویرایش شده) دوستان طبق آموزشعدم پشتیبانی قالب از rtlمی خواهم این کد فاکشنم <?php/*** @package WordPress* @subpackage bizz Theme*/// Set the content width based on the theme's design and stylesheet.if ( ! isset( $content_width ) )$content_width = 620;/*-----------------------------------------------------------------------------------*//* Include functions/*-----------------------------------------------------------------------------------*/require('admin/theme-admin.php');require('functions/pagination.php');require('functions/better-excerpts.php');require('functions/shortcodes.php');require('functions/meta/meta-box-class.php');require('functions/meta/meta-box-usage.php');require('functions/flickr-widget.php');/*-----------------------------------------------------------------------------------*//* Images/*-----------------------------------------------------------------------------------*/if ( function_exists( 'add_theme_support' ) )add_theme_support( 'post-thumbnails' );if ( function_exists( 'add_image_size' ) ) {add_image_size( 'full-size', 9999, 9999, false );add_image_size( 'nivo-slider', 910, 400, true );add_image_size( 'post-image', 660, 220, true );add_image_size( 'portfolio-thumb', 215, 140, true );add_image_size( 'portfolio-single', 500, 9999, false );/*-----------------------------------------------------------------------------------*//* Javascsript/*-----------------------------------------------------------------------------------*/add_action('wp_enqueue_scripts','my_theme_scripts_function');function my_theme_scripts_function() {//get theme optionsglobal $options;wp_deregister_script('jquery');wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"), false, '1.4.2');wp_enqueue_script('jquery');// Site wide jswp_enqueue_script('superfish', get_template_directory_uri() . '/js/superfish.js');wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js');//portfolio mainif(is_page_template('template-portfolio.php')) {wp_enqueue_script('portfolio', get_template_directory_uri() . '/js/portfolio.js');}//portfolio singleif( get_post_type() == 'portfolio') {wp_enqueue_script('prettyphoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js');}//homepage jsif(is_front_page()) {wp_enqueue_script('nivo', get_template_directory_uri() . '/js/jquery.nivo.slider.js');}}/*-----------------------------------------------------------------------------------*//* Sidebars/*-----------------------------------------------------------------------------------*///Register Sidebarsif ( function_exists('register_sidebar') )register_sidebar(array('name' => 'Sidebar','id' => 'sidebar','description' => 'Widgets in this area will be shown in the sidebar.','before_widget' => '<div class="sidebar-box clearfix">','after_widget' => '</div>','before_title' => '<h4><span>','after_title' => '</span></h4>',));if ( function_exists('register_sidebar') )register_sidebar(array('name' => 'Footer Left','id' => 'footer-left','description' => 'Widgets in this area will be shown in the footer left area.','before_widget' => '<div class="footer-widget clearfix">','after_widget' => '</div>','before_title' => '<h4>','after_title' => '</h4>',));if ( function_exists('register_sidebar') )register_sidebar(array('name' => 'Footer Middle','id' => 'footer-middle','description' => 'Widgets in this area will be shown in the footer middle area.','before_widget' => '<div class="footer-widget clearfix">','after_widget' => '</div>','before_title' => '<h4>','after_title' => '</h4>',));if ( function_exists('register_sidebar') )register_sidebar(array('name' => 'Footer Right','id' => 'footer-right','description' => 'Widgets in this area will be shown in the footer right area.','before_widget' => '<div class="footer-widget clearfix">','after_widget' => '</div>','before_title' => '<h4>','after_title' => '</h4>',));/*-----------------------------------------------------------------------------------*//* Custom Post Types & Taxonomies/*-----------------------------------------------------------------------------------*/add_action( 'init', 'create_post_types' );function create_post_types() {//slider post typeregister_post_type( 'Slides',array('labels' => array('name' => __( 'ط§ط³ظ„ط§غŒط¯ ط´ظˆ', 'bizz' ),'singular_name' => __( 'ط§ط³ظ„ط§غŒط¯', 'bizz' ),'add_new' => _x( 'ط§غŒط¬ط§ط¯ ع©ط±ط¯ظ†', 'Slide', 'bizz' ),'add_new_item' => __( 'ط§غŒط¬ط§ط¯ ط§ط³ظ„ط§غŒط¯ ط¬ط¯غŒط¯', 'bizz' ),'edit_item' => __( 'ظˆغŒط±ط§غŒط´ ط§ط³ظ„ط§غŒط¯', 'bizz' ),'new_item' => __( 'ط§ط³ظ„ط§غŒط¯ ط¬ط¯غŒط¯', 'bizz' ),'view_item' => __( 'طھظ…ط§ط´ط§ ط§ط³ظ„ط§غŒط¯', 'bizz' ),'search_items' => __( 'ط¬ط³طھط¬ظˆغŒ ط§ط³ظ„ط§غŒط¯ ظ‡ط§', 'bizz' ),'not_found' => __( 'ظ‡غŒع† ط§ط³ظ„ط§غŒط¯غŒ ظ¾غŒط¯ط§ ظ†ط´ط¯.', 'bizz' ),'not_found_in_trash' => __( 'ظ‡غŒع† ط§ط³ظ„ط§غŒط¯غŒ ط¯ط± ط²ط¨ط§ظ„ظ‡ ط¯ط§ظ† ظ¾غŒط¯ط§ ظ†ط´ط¯.', 'bizz' ),'parent_item_colon' => ''),'public' => true,'supports' => array('title','thumbnail'),'query_var' => true,'rewrite' => array( 'slug' => 'slides' ),));//hp highlightsregister_post_type( 'hp_highlights',array('labels' => array('name' => __( 'ظ‡ط§غŒظ„ط§غŒطھ', 'bizz' ),'singular_name' => __( 'ظ‡ط§غŒظ„ط§غŒطھ', 'bizz' ),'add_new' => _x( 'ط§غŒط¬ط§ط¯ ع©ط±ط¯ظ†', 'Highlight', 'bizz' ),'add_new_item' => __( 'ط§غŒط¬ط§ط¯ ظ‡ط§غŒظ„ط§غŒطھ ط¬ط¯غŒط¯', 'bizz' ),'edit_item' => __( 'ظˆغŒط±ط§غŒط´ ظ‡ط§غŒظ„ط§غŒطھ', 'bizz' ),'new_item' => __( 'ظ‡ط§غŒظ„ط§غŒطھ ط¬ط¯غŒط¯', 'bizz' ),'view_item' => __( 'طھظ…ط§ط´ط§غŒ ظ‡ط§غŒظ„ط§غŒطھ', 'bizz' ),'search_items' => __( 'ط¬ط³طھط¬ظˆغŒ ظ‡ط§غŒظ„ط§غŒطھ', 'bizz' ),'not_found' => __( 'ظ‡غŒع† ظ‡ط§غŒظ„ط§غŒطھغŒ ظ¾غŒط¯ط§ ظ†ط´ط¯.', 'bizz' ),'not_found_in_trash' => __( 'ظ‡غŒع† ظ‡ط§غŒظ„ط§غŒطھغŒ ط¯ط± ط²ط¨ط§ظ„ظ‡ ط¯ط§ظ† ظ¾غŒط¯ط§ ظ†ط´ط¯', 'bizz' ),'parent_item_colon' => ''),'public' => true,'supports' => array('title','editor'),'query_var' => true,'rewrite' => array( 'slug' => 'hp-highlights' ),));//portfolio post typeregister_post_type( 'Portfolio',array('labels' => array('name' => __( 'ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'singular_name' => __( 'Portfolio', 'bizz' ),'add_new' => _x( 'ط§غŒط¬ط§ط¯ ع©ط±ط¯ظ†', 'Portfolio Project', 'bizz' ),'add_new_item' => __( 'ط§غŒط¬ط§ط¯ ظ¾ط±ظˆعکظ‡ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط± ط¬ط¯غŒط¯', 'bizz' ),'edit_item' => __( 'ظˆغŒط±ط§غŒط´ ظ¾ط±ظˆعکظ‡ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'new_item' => __( 'ظ¾ط±ظˆعکظ‡ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط± ط¬ط¯غŒط¯', 'bizz' ),'view_item' => __( 'طھظ…ط§ط´ط§غŒ ظ¾ط±ظˆعکظ‡ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'search_items' => __( 'ط¬ط³طھط¬ظˆغŒ ظ¾ط±ظˆعکظ‡ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'not_found' => __( 'ظ‡غŒع† ظ¾ط±ظˆعکظ‡ ط§غŒ ظ¾غŒط¯ط§ ظ†ط´ط¯', 'bizz' ),'not_found_in_trash' => __( 'ظ‡غŒع† ظ¾ط±ظˆعکظ‡ ط§غŒ ط¯ط± ط²ط¨ط§ظ„ظ‡ ط¯ط§ظ† ظ¾غŒط¯ط§ ظ†ط´ط¯', 'bizz' ),'parent_item_colon' => ''),'public' => true,'supports' => array('title','editor','thumbnail'),'query_var' => true,'rewrite' => array( 'slug' => 'portfolio' ),));}// Add taxonomiesadd_action( 'init', 'create_taxonomies' );//create taxonomiesfunction create_taxonomies() {// portfolio taxonomies$cat_labels = array('name' => __( 'ظ…ظˆط¶ظˆط¹ط§طھ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'singular_name' => __( 'ظ…ظˆط¶ظˆط¹ط§طھ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'search_items' => __( 'ط¬ط³طھط¬ظˆغŒ ظ…ظˆط¶ظˆط¹ ظ†ظ…ظˆظ†ظ‡ ع©ط§ط±', 'bizz' ),'all_items' => __( 'ظ‡ظ…ظ‡ غŒ ظ…ظˆط¶ظˆط¹ط§طھ', 'bizz' ),'parent_item' => __( 'ظ…ظˆط¶ظˆط¹ ظ…ط§ط¯ط±', 'bizz' ),'parent_item_colon' => __( 'ظ…ظˆط¶ظˆط¹ ظ…ط§ط¯ط±:', 'bizz' ),'edit_item' => __( 'ظˆغŒط±ط§غŒط´ ظ…ظˆط¶ظˆط¹', 'bizz' ),'update_item' => __( 'ط¨ظ‡ ط±ظˆط²ط±ط³ط§ظ†غŒ ظ…ظˆط¶ظˆط¹ط§طھ ', 'bizz' ),'add_new_item' => __( 'ط§غŒط¬ط§ط¯ ظ…ظˆط¶ظˆط¹ ط¬ط¯غŒط¯', 'bizz' ),'new_item_name' => __( 'ظ…ظˆط¶ظˆط¹ ط¬ط¯غŒط¯', 'bizz' ),'choose_from_most_used' => __( 'ط§ظ†طھط®ط§ط¨ ط§ط² ط¨غŒظ† ظ…ظˆط¶ظˆط¹ط§طھ ط§ط³طھظپط§ط¯ظ‡ ط´ط¯ظ‡', 'bizz' ));register_taxonomy('portfolio_cats','portfolio',array('hierarchical' => true,'labels' => $cat_labels,'query_var' => true,'rewrite' => array( 'slug' => 'portfolio-category' ),));}/*-----------------------------------------------------------------------------------*//* Portfolio Cat Pagination/*-----------------------------------------------------------------------------------*/// Set number of posts per page for taxonomy pages$option_posts_per_page = get_option( 'posts_per_page' );add_action( 'init', 'my_modify_posts_per_page', 0);function my_modify_posts_per_page() {add_filter( 'option_posts_per_page', 'my_option_posts_per_page' );}function my_option_posts_per_page( $value ) {global $option_posts_per_page;if ( is_tax( 'portfolio_cats') ) { return 8;}else { return $option_posts_per_page;}}/*-----------------------------------------------------------------------------------*//* Other functions/*-----------------------------------------------------------------------------------*/// Limit Post Word Countfunction new_excerpt_length($length) {return 50;}add_filter('excerpt_length', 'new_excerpt_length');//Replace Excerpt Linkfunction new_excerpt_more($more) { global $post;return '...';}add_filter('excerpt_more', 'new_excerpt_more');}// Enable Custom Backgroundadd_custom_background();// register navigation menusregister_nav_menus(array('menu'=>__('Menu'),));/// add home link to menufunction home_page_menu_args( $args ) {$args['show_home'] = true;return $args;}add_filter( 'wp_page_menu_args', 'home_page_menu_args' );// menu fallbackfunction default_menu() {require_once (TEMPLATEPATH . '/includes/default-menu.php');}// functions run on activation --> important flush to clear rewritesif ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) {$wp_rewrite->flush_rules();}?> این کد داخلش قرار بدمfunction iptrtl_add_stylesheet() {$template_dir_uri = get_template_directory_uri();$template_dir = get_template_directory();//$stylesheet_dir = get_stylesheet_directory();if ( file_exists("$template_dir/rtl.css") ) {wp_register_style( 'parent-theme-rtl', "$template_dir_uri/rtl.css" );wp_enqueue_style( 'parent-theme-rtl' );}}add_action('wp_print_styles', 'iptrtl_add_stylesheet');متاسفانه هر کاری کردم وقرار دام خروجی اون چیزی که می خوام نشد لطفا شما کد داخل فاکشن کنید تا قالب درست بشه ویرایش شده خرداد 92 توسط Parsa نقل قول لینک به ارسال
Parsa 23463 ارسال شده در خرداد 92 گزارش بازنشر ارسال شده در خرداد 92 شما کد رو هر جایی از فایل قرار دهید درسته (داخل تگ php)فایل rtl.css هم باید در پوشه پوسته باشه 3 نقل قول لینک به ارسال
giasi 8 ارسال شده در خرداد 92 مالک گزارش بازنشر ارسال شده در خرداد 92 من ته کد گذاشتم برای همین عمل نکرد نقل قول لینک به ارسال
Parsa 23463 ارسال شده در خرداد 92 گزارش بازنشر ارسال شده در خرداد 92 ببینید در سورس صفحه فایل rtl.css هست یا نه؟ 1 نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .