رفتن به مطلب

مشکل فارسی کردن قالب


giasi

پست های پیشنهاد شده

دوستان طبق آموزش

عدم پشتیبانی قالب از 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 options

global $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 js

wp_enqueue_script('superfish', get_template_directory_uri() . '/js/superfish.js');

wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js');

//portfolio main

if(is_page_template('template-portfolio.php')) {

wp_enqueue_script('portfolio', get_template_directory_uri() . '/js/portfolio.js');

}

//portfolio single

if( get_post_type() == 'portfolio') {

wp_enqueue_script('prettyphoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js');

}

//homepage js

if(is_front_page()) {

wp_enqueue_script('nivo', get_template_directory_uri() . '/js/jquery.nivo.slider.js');

}

}

/*-----------------------------------------------------------------------------------*/

/* Sidebars

/*-----------------------------------------------------------------------------------*/

//Register Sidebars

if ( 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 type

register_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 highlights

register_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 type

register_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 taxonomies

add_action( 'init', 'create_taxonomies' );

//create taxonomies

function 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 Count

function new_excerpt_length($length) {

return 50;

}

add_filter('excerpt_length', 'new_excerpt_length');

//Replace Excerpt Link

function new_excerpt_more($more) {

global $post;

return '...';

}

add_filter('excerpt_more', 'new_excerpt_more');

}

// Enable Custom Background

add_custom_background();

// register navigation menus

register_nav_menus(

array(

'menu'=>__('Menu'),

)

);

/// add home link to menu

function home_page_menu_args( $args ) {

$args['show_home'] = true;

return $args;

}

add_filter( 'wp_page_menu_args', 'home_page_menu_args' );

// menu fallback

function default_menu() {

require_once (TEMPLATEPATH . '/includes/default-menu.php');

}

// functions run on activation --> important flush to clear rewrites

if ( 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');

متاسفانه هر کاری کردم وقرار دام خروجی اون چیزی که می خوام نشد لطفا شما کد داخل فاکشن کنید تا قالب درست بشه

ویرایش شده توسط Parsa
لینک به ارسال

شما کد رو هر جایی از فایل قرار دهید درسته (داخل تگ php)

فایل rtl.css هم باید در پوشه پوسته باشه

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...