Merhabalar,
Wordpress sitemde arama sonuçları gayet iyi olarak listeleniyor ancak ben sonuçların görsellerininde küçük resim olarak yanında gösterilmesini istiyorum. Bunula ilgili ne yapabilirim acaba? Bir makale varmıdır ya da eklenti
Wordpress Arama Sonuçlarının Resimli Listelenmesi
7
●1.443
- 21-03-2013, 23:41:08Teşekkür ederim hocam aşağıdaki gibidir.
<?php //page link $link_page=get_permalink(get_option('rttheme_blog_page')); //category link $category_id = get_the_category($post->ID); $category_id = $category_id[0]->cat_ID;//only one category can be show in the list - the first one $link_cat=get_category_link($category_id); //redirect to home page if user tries to view slider or home page contents by clicking the view link on admin $home_page=get_bloginfo('url'); if (get_query_var('home_page') || get_query_var('slider')){ header( 'Location: '.$home_page.'/ ' ) ;} get_header(); ?> <!-- Page navigation--> <div class="breadcrumb"><?php rt_breadcrumb($post->ID); ?></div> <!-- /Page navigation--> <div class="clear extra_space"></div> <!-- page contents --> <div class="content left noleftmargin"> <?php if (have_posts()) : while (have_posts()) : the_post(); $current_post=$post->ID; ?> <!-- Blog box --> <div class="blog_box"> <?php if(has_post_thumbnail()):?> <!-- blog image--> <?php if(!get_option('rttheme_blog_resize'))://RT-Theme resize option is enabled //get the image url $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'large', true); $image_url = $image_url[0]; ?> <a href="<?php echo $image_url;?>" title="<?php the_title(); ?>" rel="prettyPhoto[rt_theme_blog]" class="imgeffect plus"><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $image_url?>&w=680&h=130&zc=1" alt="" class="aligncenter" /></a> <?php else://use the post thumbnail ?> <?php $default_attr = array('class' => "attachment-$size aligncenter post_image preload"); echo get_the_post_thumbnail($post->ID,array(680, 1000),$default_attr); ?> <?php endif;?> <!-- / blog image --> <?php endif;?> <!-- blog headline--> <h2><a href="<?php echo get_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <!-- / blog headline--> <?php echo the_content(); ?> <!-- date and cathegory bar --> <div class="dateandcategories clearfix"> <div class="date"><span class="day"><?php the_time('d') ?></span><br /><?php the_time('M') ?></div> <div class="categories"><b>posted in:</b> <?php the_category(', ') ?> by <b><?php the_author_posts_link(); ?></b> <?php echo the_tags( '| <b> tags :</b>', ', ', '');?> </div> <?php $comment_count = get_comment_count($post->ID); ?> <div class="comments"><?php comments_popup_link('<span class="number">0</span><br /> Comment', '<span class="number">1</span><br /> Comment', '<span class="number">% </span><br /> Comments'); ?></div> </div> <!-- / date and cathegory bar --> </div> <!-- / Blog box --> <div class="line blog"></div> <?php endwhile;?> <?php else: ?> <p><?php _e( 'Sorry, no page found.', 'rt_theme' ); ?></p> <?php endif; ?> <div class='entry commententry'> <?php comments_template(); ?> </div> </div> <!-- / page contents --> <!-- side bar --> <div class="sidebar_right"> <?php include(TEMPLATEPATH."/sidebar.php"); ?> </div> <!-- / side bar --> <?php get_footer();?> - 21-03-2013, 23:48:39Site içi arama sonuçları hocam google ile filan işim yok.


<?php /* * rt-theme search */ get_header(); ?> <!-- Page navigation--> <div class="breadcrumb"><?php rt_breadcrumb($post->ID); ?></div> <!-- /Page navigation--> <div class="clear extra_space"></div> <!-- page contents --> <div class="content left noleftmargin"> <!-- Page Title --> <h2 class="blog"><?php wp_title(''); ?></h2> <div class="line blog"></div> <!-- / Page Title --> <?php get_template_part( 'loop', 'archive' );?> <div class="clear"></div> </div> <!-- / page contents --> <!-- side bar --> <div class="sidebar_right"> <?php include(TEMPLATEPATH."/sidebar.php"); ?> </div> <!-- / side bar --> <?php get_footer();?> - 21-03-2013, 23:51:23arama sonucunun döndüğü sayfada resmin gözükmesini istediğiniz yere aşağıdaki kodları yapıştırın
<?php if(has_post_thumbnail()):?>
<!-- blog image-->
<?php
if(!get_option('rttheme_blog_resize'))://RT-Theme resize option is enabled
//get the image url
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
$image_url = $image_url[0];
?>
<a href="<?php echo $image_url;?>" title="<?php the_title(); ?>" rel="prettyPhoto[rt_theme_blog]" class="imgeffect plus"><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $image_url?>&w=680&h=130&zc=1" alt="" class="aligncenter" /></a>
<?php else://use the post thumbnail ?>
<?php
$default_attr = array('class' => "attachment-$size aligncenter post_image preload");
echo get_the_post_thumbnail($post->ID,array(680, 1000),$default_attr);
?>
<?php endif;?>
<!-- / blog image -->
<?php endif;?>
