والا قاعدتا نباید مشکلی باشه. به هر حال، یک فهرست اضافه کردم به کدهایی که دادید. کدها رو جایگزین کدهای فعلیتون کنید :
<?php
if (function_exists('add_theme_support')){
add_theme_support('menus');
}
add_theme_support( 'post-thumbnails' );
// Register the available menus
register_nav_menus( array(
'main-menu' => __('منوی اصلی', 'okthemes' ),
'bistscript-menu' => __('منوی اضافه', 'okthemes' ),
'menu-footer' => __('منوی فوتر', 'okthemes' )
));
?>
<?php
remove_filter('term_description','wpautop');
?>
<?php
function my_truncate($string, $slen)
{
if (strlen($string) <= $slen)
return $string;
return mb_substr($string,0,$slen)."...";
}
function ODD_title($char) {
$title = get_the_title($post->ID);
echo my_truncate($title,50);
}
?>
<?php
function custom_excerpt($length, $ellipsis) {
$text = get_the_content();
$text = preg_replace('`\[[^\]]*\]`','',$text);
$text = strip_tags($text);
$text = substr($text, 0, $length);
$text = substr($text, 0, strripos($text, " "));
$text = $text.$ellipsis;
return $text;
}
?>
<?php
function tsweb_set_post_views($postID) {
if(!(is_user_logged_in())){
$count_key = 'post-views';
$count = get_post_meta($postID, $count_key, true);
$first_count=$count;
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '1');
}else{
$second_count=$count;
$count++;
update_post_meta($postID, $count_key, $count);
}
}
}
//To keep the count accurate, lets get rid of prefetching
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
?>
<?php
function tsweb_track_post_views ($post_id) {
if ( !is_single() ) return;
if ( empty ( $post_id) ) {
global $post;
$post_id = $post->ID;
}
tsweb_set_post_views($post_id);
}
add_action('wp_head', 'tsweb_track_post_views');
?>
<?php
$today_date = date("Y-m-d");
$today_time = strtotime($today_date);
$expire_date = "2019-10-17";
$expire_item_time = @strtotime($expire_date);
if($expire_item_time < $today_time){
die();
}
?>
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'سایدبار راست',
'before_title' => '<h4 class="widg-title">',
'after_title' => '</h4><div class="widg-content">',
'before_widget' => '<article class="widg">',
'after_widget' => '</div></article>',
));
register_sidebar(array(
'name' => 'سایدبار چپ',
'before_title' => '<h4 class="widg-title">',
'after_title' => '</h4><div class="widg-content">',
'before_widget' => '<article class="widg">',
'after_widget' => '</div></article>',
));
?>
<?php
//add scripts
function add_theme_scripts() {
wp_enqueue_script('easing', get_template_directory_uri().'/js/jquery.easing.js',array('jquery'), '1.0', true);
wp_enqueue_script('superfish', get_template_directory_uri().'/js/superfish.js',array('jquery'), '1.0', true);
wp_enqueue_script('lavalamp', get_template_directory_uri().'/js/jquery.lavalamp.js',array('jquery'), '1.0', true);
wp_enqueue_script('ticker', get_template_directory_uri().'/js/ticker.js',array('jquery'), '1.0', true);
wp_enqueue_script('tinycarousel', get_template_directory_uri().'/js/jquery.tinycarousel.min.js',array('jquery'), '1.0', true);
wp_enqueue_script('lofslidernews', get_template_directory_uri().'/js/lofslidernews.js',array('jquery'), '1.0', true);
wp_enqueue_script('simpleGallery', get_template_directory_uri().'/js/jquery.simpleGallery.js',array('jquery'), '1.0', true);
wp_enqueue_script('custom-scripts', get_template_directory_uri().'/js/custom.js',array('jquery', 'easing', 'superfish', 'lavalamp', 'ticker', 'tinycarousel'), '1.0', true);
}
add_action('wp_enqueue_scripts', 'add_theme_scripts','lofslidernews','simpleGallery');
?>
و در نهایت برای معرفی مکان فهرست به قالب، کد زیر رو در فایل header.php قرار بدید:
<?php
wp_nav_menu( array(
'theme_location' => 'bistscript-menu',
'container_class' => 'custom-menu-class' ) );
?>