silver21 122 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) لطفا راهنمایی کنید ؛ میخوام تیترهای این سایت رو ( در عکس پیوست مشخص کردم ، منظورم کدوم تیتر هست) تبدیل به لینک کنم که با کلیک ، همه نوشته های اون دسته نشون داده بشن در حال حاضر به صورت لینک نیست و کدش به این صورته:class ThematerPosts extends WP_Widget{function __construct(){ $widget_options = array('description' => __('Advanced widget for displaying the recent posts or posts from the selected categories or tags.', 'themater') ); $control_options = array( 'width' => 400);$this->WP_Widget('themater_posts', '» Posts with Images', $widget_options, $control_options);}function widget($args, $instance){ global $theme; extract( $args ); $title = apply_filters('widget_title', $instance['title']);?><div class="cankh"><div class="cat-widget"> <div class="ts"><?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?> <?php switch ($instance['order_by']) { case 'none' : $order_query = ''; break; case 'id_asc' : $order_query = '&orderby=ID&order=ASC'; break; case 'id_desc' : $order_query = '&orderby=ID&order=DESC'; break; case 'date_asc' : $order_query = '&orderby=date&order=ASC'; break; case 'date_desc' : $order_query = '&orderby=date&order=DESC'; break; case 'title_asc' : $order_query = '&orderby=title&order=ASC'; break; case 'title_desc' : $order_query = '&orderby=title&order=DESC'; break; default : $order_query = '&orderby=' . $instance['order_by']; } switch ($instance['filter']) { case 'cats' : $filter_query = '&cat=' . trim($instance['filter_cats']) ; break; case 'category' : $filter_query = '&cat=' . trim($instance['selected_category']) ; break; case 'tags' : $filter_query = '&tag=' . trim($instance['filter_tags']) ; break; default : $filter_query = ''; } query_posts('posts_per_page=' . $instance['posts_number'] . $filter_query . $order_query); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>منظورم این بخشه:<?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?> ویرایش شده تیر 92 توسط silver21 نقل قول لینک به ارسال
ali56 197 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 به این صورت<?php if ( $title ) { ?><h3 class="cankh2"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3><?php } ?> 3 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 نشد، همه تیترها تبدیل شد به آخرین مطلبی که به سایت ارسال شده ؛ البته لینک به خود اون مطلب نقل قول لینک به ارسال
نسـتـــرن 194 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 با سلامباید داخل اچ تی ام ال یا حالا محل تب کد زیر رو پیدا کنین:<h3 class="cankh2">خبر روز</h3>تبدیلش کنین به :<h3 class="cankh2"><a href="<?php the_permalink(); ?>" rel="bookmark" title="لينک ثابت <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> 3 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) نمیشه ، قبلا هم اینکارو انجام دادم ولی نمیشه مجموعه کد مرتبط به این widget رو میذارم ؛ یه جای کار مشکلی داره نمیدونم شاید از حلقه ای یا فراخوانی چیزی.. <?phpglobal $theme;$themater_posts_defaults = array('title' => 'Recent Posts','posts_number' => '5','order_by' => 'none','display_title' => 'true','display_date' => 'true','display_author' => 'true','display_content' => 'true','display_featured_image' => 'true','display_read_more' => 'true','content_type' => 'the_excerpt','excerpt_length' => '26','featured_image_width' => '90','featured_image_height' => '60','featured_image_align' => 'alignleft','filter' => 'recent','filter_cats' => '','filter_tags' => '');$theme->options['widgets_options']['posts'] = is_array($theme->options['widgets_options']['posts'])? array_merge($themater_posts_defaults, $theme->options['widgets_options']['posts']): $themater_posts_defaults;add_action('widgets_init', create_function('', 'return register_widget("ThematerPosts");'));class ThematerPosts extends WP_Widget{function __construct(){$widget_options = array('description' => __('Advanced widget for displaying the recent posts or posts from the selected categories or tags.', 'themater') );$control_options = array( 'width' => 400);$this->WP_Widget('themater_posts', '» Posts with Images', $widget_options, $control_options);}function widget($args, $instance){global $theme;extract( $args );$title = apply_filters('widget_title', $instance['title']);?><div class="cankh"><div class="cat-widget"><div class="ts"><?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?><?phpswitch ($instance['order_by']) {case 'none' : $order_query = ''; break;case 'id_asc' : $order_query = '&orderby=ID&order=ASC'; break;case 'id_desc' : $order_query = '&orderby=ID&order=DESC'; break;case 'date_asc' : $order_query = '&orderby=date&order=ASC'; break;case 'date_desc' : $order_query = '&orderby=date&order=DESC'; break;case 'title_asc' : $order_query = '&orderby=title&order=ASC'; break;case 'title_desc' : $order_query = '&orderby=title&order=DESC'; break;default : $order_query = '&orderby=' . $instance['order_by'];}switch ($instance['filter']) {case 'cats' : $filter_query = '&cat=' . trim($instance['filter_cats']) ; break;case 'category' : $filter_query = '&cat=' . trim($instance['selected_category']) ; break;case 'tags' : $filter_query = '&tag=' . trim($instance['filter_tags']) ; break;default : $filter_query = '';}query_posts('posts_per_page=' . $instance['posts_number'] . $filter_query . $order_query);if ( have_posts() ) : while ( have_posts() ) : the_post(); ?><div class="clearfix"><div class="cattak"><div <?php post_class('post post-box clearfix'); ?> id="post-<?php the_ID(); ?>"><div class="entryclearfix"><?phpif(has_post_thumbnail()) {?><div class="featured-image-container"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?></a></div><?php}?><div class="box-tit"><h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'themater' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2><div class="postmeta-primary"><span class="meta_date"><?php the_time(__('y/m/d', PADD_THEME_SLUG)); ?></span><span class="meta_author"><?php the_author(); ?></span><div class="st5"> <?php the_ratings(); ?></div><?php if(comments_open( get_the_ID() )) {?> <?php}?></div></div><p><?phpecho $theme->shorten(get_the_excerpt(), '25');_e('...');?></p></div><?php if($theme->display('read_more')) { ?><div class="readmore"><a href="<?php the_permalink(); ?>#more-<?php the_ID(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'themater' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php $theme->option('read_more'); ?></a></div><?php } ?></div></div> </div><?phpendwhile;endif;wp_reset_query();?></div></div></div><?php}function update($new_instance, $old_instance){$instance = $old_instance;$instance['title'] = strip_tags($new_instance['title']);$instance['posts_number'] = strip_tags($new_instance['posts_number']);$instance['order_by'] = strip_tags($new_instance['order_by']);$instance['display_title'] = strip_tags($new_instance['display_title']);$instance['display_date'] = strip_tags($new_instance['display_date']);$instance['display_author'] = strip_tags($new_instance['display_author']);$instance['content_type'] = strip_tags($new_instance['content_type']);$instance['display_content'] = strip_tags($new_instance['display_content']);$instance['display_featured_image'] = strip_tags($new_instance['display_featured_image']);$instance['display_read_more'] = strip_tags($new_instance['display_read_more']);$instance['excerpt_length'] = strip_tags($new_instance['excerpt_length']);$instance['featured_image_width'] = strip_tags($new_instance['featured_image_width']);$instance['featured_image_height'] = strip_tags($new_instance['featured_image_height']);$instance['featured_image_align'] = strip_tags($new_instance['featured_image_align']);$instance['filter'] = strip_tags($new_instance['filter']);$instance['filter_cats'] = strip_tags($new_instance['filter_cats']);$instance['selected_category'] = strip_tags($new_instance['selected_category']);$instance['filter_tags'] = strip_tags($new_instance['filter_tags']);return $instance;}function form($instance){global $theme;$instance = wp_parse_args( (array) $instance, $theme->options['widgets_options']['posts'] );?><div class="tt-widget"><table width="100%"><tr><td class="tt-widget-label" width="25%"><label for="<?php echo $this->get_field_id('title'); ?>">Title:</label></td><td class="tt-widget-content" width="75%"><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" /></td></tr><tr><td class="tt-widget-label"><label for="<?php echo $this->get_field_id('posts_number'); ?>">Number Of Posts:</label></td><td class="tt-widget-content"><input class="widefat" id="<?php echo $this->get_field_id('posts_number'); ?>" name="<?php echo $this->get_field_name('posts_number'); ?>" type="text" value="<?php echo esc_attr($instance['posts_number']); ?>" /></td></tr><tr><td class="tt-widget-label"><label for="<?php echo $this->get_field_id('order_by'); ?>">Order Posts By:</label></td><td class="tt-widget-content"><select id="<?php echo $this->get_field_id('order_by'); ?>" name="<?php echo $this->get_field_name('order_by'); ?>"><option value="none" <?php selected('none', $instance['order_by']); ?> >None (Default)</option><option value="id_asc" <?php selected('id_asc', $instance['order_by']); ?> >ID ( Ascending ) </option><option value="id_desc" <?php selected('id_desc', $instance['order_by']); ?> >ID ( Descending ) </option><option value="date_asc" <?php selected('date_asc', $instance['order_by']); ?>>Date ( Ascending ) </option><option value="date_desc" <?php selected('date_desc', $instance['order_by']); ?>>Date ( Descending ) </option><option value="title_asc" <?php selected('title_asc', $instance['order_by']); ?>>Title ( Ascending ) </option><option value="title_desc" <?php selected('title_desc', $instance['order_by']); ?>>Title ( Descending ) </option><option value="rand" <?php selected('rand', $instance['order_by']); ?>>Random</option></select></td></tr><tr><td class="tt-widget-label">Display Elements:</td><td class="tt-widget-content"><input type="checkbox" name="<?php echo $this->get_field_name('display_title'); ?>" <?php checked('true', $instance['display_title']); ?> value="true" /> Post Title<br /><input type="checkbox" name="<?php echo $this->get_field_name('display_date'); ?>" <?php checked('true', $instance['display_date']); ?> value="true" /> Date<br /><input type="checkbox" name="<?php echo $this->get_field_name('display_author'); ?>" <?php checked('true', $instance['display_author']); ?> value="true" /> Author<br /><input type="checkbox" name="<?php echo $this->get_field_name('display_content'); ?>" <?php checked('true', $instance['display_content']); ?> value="true" /> The Content / The Excerpt<br /><input type="checkbox" name="<?php echo $this->get_field_name('display_featured_image'); ?>" <?php checked('true', $instance['display_featured_image']); ?> value="true" /> Thumbnail<br /><input type="checkbox" name="<?php echo $this->get_field_name('display_read_more'); ?>" <?php checked('true', $instance['display_read_more']); ?> value="true" /> "Read More" Link</td></tr><tr><td class="tt-widget-label">Content Type:</td><td class="tt-widget-content"><input type="radio" name="<?php echo $this->get_field_name('content_type'); ?>" <?php checked('the_content', $instance['content_type']); ?> value="the_content" /> The Content<br /><input type="radio" name="<?php echo $this->get_field_name('content_type'); ?>" <?php checked('the_excerpt', $instance['content_type']); ?> value="the_excerpt" /> The Excerpt <label for="<?php echo $this->get_field_id('excerpt_length'); ?>">The Excerpt Length:</label> <input style="width: 40px;" id="<?php echo $this->get_field_id('excerpt_length'); ?>" name="<?php echo $this->get_field_name('excerpt_length'); ?>" type="text" value="<?php echo esc_attr($instance['excerpt_length']); ?>" /> <span class="tt-widget-help">words</span></td></tr><tr><td class="tt-widget-label">Thumbnail:</td><td class="tt-widget-content">Width: <input type="text" style="width: 40px;" name="<?php echo $this->get_field_name('featured_image_width'); ?>" value="<?php echo esc_attr($instance['featured_image_width']); ?>" /> Height: <input type="text" style="width: 40px;" name="<?php echo $this->get_field_name('featured_image_height'); ?>" value="<?php echo esc_attr($instance['featured_image_height']); ?>" /> Float: <select name="<?php echo $this->get_field_name('featured_image_align'); ?>"><option value="alignleft" <?php selected('alignleft', $instance['featured_image_align']); ?> >Left</option><option value="alignright" <?php selected('alignright', $instance['featured_image_align']); ?>>Right</option><option value="aligncenter" <?php selected('aligncenter', $instance['featured_image_align']); ?>>Center</option></select></td></tr><tr><td class="tt-widget-label">Filter:</td><td class="tt-widget-content" style="padding-top: 5px;"><input type="radio" name="<?php echo $this->get_field_name('filter'); ?>" <?php checked('recent', $instance['filter']); ?> value="recent" /> Show Recent Posts <br /><br /><input type="radio" name="<?php echo $this->get_field_name('filter'); ?>" <?php checked('category', $instance['filter']); ?> value="category" /> Show Posts from a sinle category:<br /><select name="<?php echo $this->get_field_name('selected_category'); ?>"><?php$categories = get_categories('hide_empty=0');foreach ($categories as $category) {$category_selected = $this->get_field_name('selected_category') == $category->cat_ID ? ' selected="selected" ' : '';?><option value="<?php echo $category->cat_ID; ?>" <?php selected($category->cat_ID, $instance['selected_category']); ?> ><?php echo $category->cat_name; ?></option><?php}?></select><br /><br /><input type="radio" name="<?php echo $this->get_field_name('filter'); ?>" <?php checked('cats', $instance['filter']); ?> value="cats" /> <label for="<?php echo $this->get_field_id('filter_cats'); ?>">Show posts from selected categories:</label><br /><span class="tt-widget-help">Category IDs ( e.g: 5,9,24 )</span><br /><input class="widefat" id="<?php echo $this->get_field_id('filter_cats'); ?>" name="<?php echo $this->get_field_name('filter_cats'); ?>" type="text" value="<?php echo esc_attr($instance['filter_cats']); ?>" /><br /><br /><input type="radio" name="<?php echo $this->get_field_name('filter'); ?>" <?php checked('tags', $instance['filter']); ?> value="tags" /> <label for="<?php echo $this->get_field_id('filter_tags'); ?>">Show only posts tagged with:</label><br /><span class="tt-widget-help">Tag slugs ( e.g: computer,news,business-news )</span><br /><input class="widefat" id="<?php echo $this->get_field_id('filter_tags'); ?>" name="<?php echo $this->get_field_name('filter_tags'); ?>" type="text" value="<?php echo esc_attr($instance['filter_tags']); ?>" /></td></tr></table></div><?php}}?> میدونم که باید این تغییر کنه ولی مواردی که گفتید ، نتیجه نمیده<?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?> ویرایش شده تیر 92 توسط Morteza نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 یا من بد متوجه شدم یا دوستان!میخواین به آخرین مطالب دسته لینک بشه؟ این بخش (تیتر) در پوسته ثابت هست؟ 1 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) میخوام با کلیک بر روش ، بره مطالب همون دسته رو لود کنه ( مثل ساب منویی که بالای سایت هست این تیترها هم لینکدار بشن )یه چیزه دیگه : این کد:<?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?>مربوط به تیتری هست که من به صورت دستی بعنوان title به widget دادم .نمیدونم متوجه شدین یا نه ( یا تیترهایی که تو عکس پیوست مشخصه تبدیل بشن به لینک دسته مورد نظر یا اینکه یه لینکی بدین که بذارم بین این کدها تا بره همه مطالب اون دسته رو نشون بده)- به فایل پیوست نگاه کنید مربوط هست به سایت خبرآنلاین، میخوام یه چنین عملی انجام بده ؛ اگه کد rss یا کلا widget مشابه اینکه در این سایت هست معرفی کنید که دیگه عالیه و دردسرمم کمتر. ویرایش شده تیر 92 توسط silver21 نقل قول لینک به ارسال
نسـتـــرن 194 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 خوب الان این کد رو ببینینی:<h3 class="cankh2"><?php echo $title; ?></h3><?php } ?>الان داره میگه داخل کلاس سنخ2 فقط عنوان رو نشون بده.الان اگه این ی تیکه رو عوض کنین:<?php echo $title; ?>به:<a href="<?php the_permalink(); ?>">بعد آخرشم ی < / a > اضافه کنین درست نمیشه یعنی؟ نقل قول لینک به ارسال
!Mojtaba 980 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 دوستان ایشون میخان نام هر دسته بندی که روی هر دستشون هست رو لینک دار کنن تا بره به همون دسته مثلا دسته "زندگی" که اسم زندگی روی عنوان دسته بندیشون هست رو لینک دار کنن <div class="myCatzendegi"><h3 class="front">زندگی</h3> <div class="myCat1"><?phpquery_posts('cat=9&showposts=1');if(have_posts()): while(have_posts()): the_post();?><?php the_post_thumbnail(); ?><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><?php the_excerpt(); ?><?phpendwhile; endif;wp_reset_query();?> </div> <div class="myCat2"><?phpquery_posts('cat=9&showposts=5&offset=1');if(have_posts()): while(have_posts()): the_post();?><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><?phpendwhile; endif;wp_reset_query();?> </div> <div class="myCat3"><?phpquery_posts('cat=9&showposts=1&offset=1');if(have_posts()): while(have_posts()): the_post();?><?php the_post_thumbnail(); ?><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><?php the_excerpt(); ?><?phpendwhile; endif;wp_reset_query();?> </div></div> 2 نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 ?php$categories = get_the_category();$separator = ' ';$output = '';if($categories){foreach($categories as $category) { $output .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator;}echo trim($output, $separator);}?>http://codex.wordpress.org/Function_Reference/get_the_categoryh'v nhog aاگر در کد بالا بخواهید بگذارید که title توش معرفی شده کد تگ h3 می شه <?php$category = get_the_category();if($category[0]){ ?><h3><a href=" <?php echo get_category_link($category[0]->term_id );?>"><?php echo $title;?></a><h3><?php}?> 3 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) استاد خیلی نزدیک گفتی تا یه جایی شد ولی نه دقیق / نتیجه رو نگاه کنیدوقتی کد رو به این حالت قرار دادم: <?php switch ($instance['order_by']) { case 'none' : $order_query = ''; break; case 'id_asc' : $order_query = '&orderby=ID&order=ASC'; break; case 'id_desc' : $order_query = '&orderby=ID&order=DESC'; break; case 'date_asc' : $order_query = '&orderby=date&order=ASC'; break; case 'date_desc' : $order_query = '&orderby=date&order=DESC'; break; case 'title_asc' : $order_query = '&orderby=title&order=ASC'; break; case 'title_desc' : $order_query = '&orderby=title&order=DESC'; break; default : $order_query = '&orderby=' . $instance['order_by']; } switch ($instance['filter']) { case 'cats' : $filter_query = '&cat=' . trim($instance['filter_cats']) ; break; case 'category' : $filter_query = '&cat=' . trim($instance['selected_category']) ; break; case 'tags' : $filter_query = '&tag=' . trim($instance['filter_tags']) ; break; default : $filter_query = ''; } query_posts('posts_per_page=' . $instance['posts_number'] . $filter_query . $order_query); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="clearfix"> <div class="cattak"> <div <?php post_class('post post-box clearfix'); ?> id="post-<?php the_ID(); ?>">-------------------------------- <div class="entryclearfix"><?php$category = get_the_category();if($category[0]){ ?><h3><a href=" <?php echo get_category_link($category[0]->term_id );?>"><?php echo $title;?></a><h3><?php}?>---------------------------------- <?php if(has_post_thumbnail()) { ?> <div class="featured-image-container"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?></a></div><?php } ?> ویرایش شده تیر 92 توسط silver21 1 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) به این شکل شد و سه بار تکرار ، و لینک دهیش دقیق نیست؛ حس میکنم باید ترکیبی متناسب با این موارد برنامه نویسی بشه ؛ بخاطر اینکه وقتی بعد از این موارد قرار میدم (در پست بالا مشخصه) برای هر مورد تیتر تکرار میشه : switch ($instance['filter']) { case 'cats' : $filter_query = '&cat=' . trim($instance['filter_cats']) ; break; case 'category' : $filter_query = '&cat=' . trim($instance['selected_category']) ; break; case 'tags' : $filter_query = '&tag=' . trim($instance['filter_tags']) ; break; default : $filter_query = ''; } ویرایش شده تیر 92 توسط silver21 نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 لینکی که دادید باز نمی شه و من متوجه نشدم وقتی اینجوری استفاده کردید چی شداین کد به اولین دسته بندی مطلبی که توشه لینک می ده در مورد مطالب با بیش از یک دسته بندی راه دیگه ای نیست مگر کدی از مبنا براش نوشته بشه 1 نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 این کد را تست کنید <?php$category = get_the_category(); ?><h3><a href="<?php echo get_category_link($category);?>"><?php echo $title; ?></a><h3> 3 نقل قول لینک به ارسال
silver21 122 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) قرار دادم ولی لینک فقط به بخش it لینک میشن، همشون.میتونید یه کلاس یا تگ برای این کد تعریف کنید:<?php$category = get_the_category();if($category[0]){echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';}?>ظاهرا اینی که درست کردم مشکل داره!<?php$category = get_the_category();if($category[0]){<h3><a href="<?php echo get_category_link($category[0]->term_id );?>"><?php echo $category[0]->cat_name;?></a></h3>}?> ویرایش شده تیر 92 توسط silver21 نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 <?php$category = get_the_category();if($category[0]){?><h3><a class="my-category-h3" href="<?php echo get_category_link($category[0]->term_id );?>"><?php echo $category[0]->cat_name;?></a></h3><?php}?> 4 نقل قول لینک به ارسال
abdy 28 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 سلامـمن فقط حالتی رو در نظر میگیرم که یه دسته رو انتخاب کردی ( توی فرم ابزارک از لیست )داخل کدهای ابزارک ( که صفحه قبل گذاشتی) به جای خط زیر:<?php if ( $title ) { ?><h3 class="cankh2"><?php echo $title; ?></h3><?php } ?>کد زیر رو جایگزین کن:<?php$my_selected_cat_link = '#';if( $instance['filter'] == 'category' ){ $my_selected_cat_id = (int) trim($instance['selected_category']); $my_selected_cat_link = get_category_link( $my_selected_cat_id);} //end ifif ( $title ){ echo sprintf('<h3 class="cankh2"><a href="%s" >%s </a></h3>', $my_selected_cat_link, $title);}//end if?>موفق باشیـ.. نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .