How to add a sticky post section in wordpress theme without plugin

ওয়ার্ডপ্রেস এর অনেক থিম এ স্টিকি পোষ্ট প্রদর্শন করার অপশন নেই । তাই আমরা বিভিন্ন রকম প্লাগইন ব্যাবহার করে থাকি । এই পোষ্টের নীচের কোডটি আপনার ওয়ার্ডপ্রেস থিম এর index.php ফাইলে নীচের কোডটি পেষ্ট করুন ।[php]<code> <!–?php if ( is_sticky() ) : ?–></code>

<center>
<p style="font-size: 20px; color: red;">নির্বাচিত পোষ্ট</p>
&nbsp;

</center>
<div><!–?php <br ?–> $sticky = get_option( ‘sticky_posts’ );
$sticky_query = new WP_Query( ‘p=’ . $sticky[0] );
// The Loop
while ( $sticky_query-&gt;have_posts() ) : $sticky_query-&gt;the_post(); ?&gt;
<div class="featured"><article class="clearfix">
<h2></h2>
লেখকঃ<b><!–?php the_author_posts_link(); ?–></b> , তারিখঃ <!–?php the_time(‘d F Y’) ?–>

<!–?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.<br ?–> echo ‘<a href="’.get_permalink().’">’;
the_post_thumbnail();
echo ‘</a>’;
} else {

}?&gt;

&nbsp;
<p style="font-size: 14px; color: blue;">বিভাগঃ <!–?php the_category(‘, ‘) ?–>,<!–?php comments_number(‘ মন্তব্য নেই ‘,’১টি মন্তব্য ‘,’% টি মন্তব্য ‘); ?–></p>

</article></div>
</div>
&nbsp;

<!–?php endif;?–>[/php]

রেটিং করুনঃ
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
মিতা- র আরো পোষ্ট দেখুন