اذهب إلى المحتوى
  • 0

ملف single.php لا يعمل في قالبي

oussama wari

السؤال

السلام عليكم و رحمة الله تعالى و بركاته 

أنا أقوم حاليا ببرمجة قالب ووردبريس . انتهيت من تصميم القالب ب html بالفعل و كذلك تقسيمه ليصبح مكون ب php .

لكن لدي مشكلة في ملف single.php لا أدري ما السبب لكنه لا يعمل مهما حاولت .

هذا هو كود الملف :

<?php get_header(); ?>
<div class="container">
<div class="homebody">
<div class="container-fluid">
 <div class="postspages">
 <?php if(have_posts()) : ?>
  <?php while(have_posts()) : the_post(); ?>
    <div class="showsingle">
    <div class="row">
        <div class="col-md-12 titlepos">
                <div class="single-title"><?php the_title(); ?></div>
                <div class="post-meta">
<span><i class="fa fa-user-circle"></i>&nbsp;نشرت بواسطة:<?php the_author_posts_link(); ?></span>
<span><i class="fa fa-calendar"></i>&nbsp;<?php the_date( 'Y/m/d' ); ?></span>
<span><i class="fa fa-eye"></i>&nbsp;<?php echo getPostViews(get_the_ID()); ?> مشاهدة</span>
<span><i class="fa fa-comment"></i>&nbsp;عدد التعليقات : <?php comments_popup_link('0', '1', '%'); ?></span>
<span><i class="fa fa-external-link"></i>&nbsp;<a href="https://www.tlabna.net/tollabna/%d8%a7%d9%84%d8%a7%d9%82%d8%b3%d8%a7%d9%85-%d8%a7%d9%84%d9%85%d8%b3%d8%a7%d9%86%d8%af%d9%87/%d8%a7%d8%ae%d8%a8%d8%a7%d8%b1-%d9%88%d9%86%d8%aa%d8%a7%d8%a6%d8%ac" rel="category tag">اخبار ونتائج</a></span> 
                </div>
             </div>
                 <div class="col-md-12 content">
 	 <?php the_content(); ?>
	</div>
		</div>
    </div>
 <?php endwhile; ?>
 <?php endif; ?>
 	<div class="postssa">
 	<div class="row">
         <div class="col-md-12 comments">
         	 <?php comments_template(); ?> 
         </div>
         </div>
	 </div>
 </div>

 
</div>
</div>
</div>
<?php get_footer(); ?>

و هذا كود ملف functions.php  هل من الممكن أن يكون المشكل أو الخلل منه ما رأيكم ؟؟

<?php
if(function_exists('add_theme_support'))
add_theme_support('post-thumbnails');

add_image_size( 'logo', 400, 175 );
	add_theme_support( 'custom-logo', array( 'size' => 'logo' ) );


function do_html_title($page_title){  
		$title = $page_title. ' | Oussama Testing site';
		return $title;
	};

function new_excerpt_length($length) {
return 200;
}
add_filter('excerpt_length', 'new_excerpt_length');

function register_my_menus(){
register_nav_menus(
array(
'navbar' => __( 'التصنيفات' ),
)
);
}
add_action( 'init', 'register_my_menus' );

function getPostViews($postID){
 $count_key = 'post_views_count';
 $count = get_post_meta($postID, $count_key, true);
 if($count==''){
 delete_post_meta($postID, $count_key);
 add_post_meta($postID, $count_key, '0');
 return "0 View";
 }
 return $count.'مشاهدة';
}
function setPostViews($postID) {
 $count_key = 'post_views_count';
 $count = get_post_meta($postID, $count_key, true);
 if($count==''){
 $count = 0;
 delete_post_meta($postID, $count_key);
 add_post_meta($postID, $count_key, '0');
 }else{
 $count++;
 update_post_meta($postID, $count_key, $count);
 }
}

function wp_bs_pagination($pages = '', $range = 4)
 
{  
 
     $showitems = ($range * 2) + 1;  
 
 
 
     global $paged;
 
     if(empty($paged)) $paged = 1;
 
 
 
     if($pages == '')
 
     {
 
         global $wp_query; 
 
		 $pages = $wp_query->max_num_pages;
 
         if(!$pages)
 
         {
 
             $pages = 1;
 
         }
 
     }   
 
 
 
     if(1 != $pages)
 
     {
 
        echo '<div class="text-center">'; 
        echo '<nav><ul class="pagination"><li class="disabled hidden-xs"><span><span aria-hidden="true">Page '.$paged.' of '.$pages.'</span></span></li>';
 
         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<li><a href='".get_pagenum_link(1)."' aria-label='First'>&laquo;<span class='hidden-xs'> First</span></a></li>";
 
         if($paged > 1 && $showitems < $pages) echo "<li><a href='".get_pagenum_link($paged - 1)."' aria-label='Previous'>&lsaquo;<span class='hidden-xs'> Previous</span></a></li>";
 
 
 
         for ($i=1; $i <= $pages; $i++)
 
         {
 
             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
 
             {
 
                 echo ($paged == $i)? "<li class=\"active\"><span>".$i." <span class=\"sr-only\">(current)</span></span>
 
    </li>":"<li><a href='".get_pagenum_link($i)."'>".$i."</a></li>";
 
             }
 
         }
 
 
 
         if ($paged < $pages && $showitems < $pages) echo "<li><a href=\"".get_pagenum_link($paged + 1)."\"  aria-label='Next'><span class='hidden-xs'>Next </span>&rsaquo;</a></li>";  
 
         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<li><a href='".get_pagenum_link($pages)."' aria-label='Last'><span class='hidden-xs'>Last </span>&raquo;</a></li>";
 
         echo "</ul></nav>";
         echo "</div>";
     }
 
} ?>

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...