رفتن به مطلب

کوچک کردن تصویر شاخص


ict universe

پست های پیشنهاد شده

با سلام من یه سایت درست کردم که در ادامه مطلب تصاویر شاخص خیلی بزرگ هست

http://bornaict.ir/92/%D9%82%DB%8C%D9%85%D8%AA-%D8%AF%D9%88%D8%B1%D8%A8%DB%8C%D9%86-%D9%87%D8%A7%DB%8C-%D8%AF%D8%A7%D9%85-%D8%B3%D9%82%D9%81%DB%8C-%D8%AF%DB%8C%D8%AF-%D8%AF%D8%B1-%D8%B4%D8%A8/

کد single


<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Pytheas
* @since Pytheas 1.0
*/
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<header class="page-header">
<h1 class="page-header-title"><?php the_title(); ?></h1>
<nav class="single-nav clr">
<?php next_post_link('<div class="single-nav-left">%link</div>', '<i class="icon-chevron-right"></i>', false); ?>
<?php previous_post_link('<div class="single-nav-right">%link</div>', '<i class="icon-chevron-left"></i>', false); ?>
</nav><!-- .page-header-title -->
</header><!-- .page-header -->

<div id="primary" class="content-area span_16 col clr clr-margin">
<div id="content" class="site-content" role="main">
<?php if ( !post_password_required() ) { ?>
<ul class="meta single-meta clr">
<li><i class="icon-time"></i><?php echo get_the_date(); ?></li>
<li><i class="icon-folder-open"></i><?php the_category(' / '); ?></li>
<?php if( comments_open() ) { ?>
<li class="comment-scroll"><i class="icon-comment"></i> <?php comments_popup_link(__('Leave a comment', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link', __('Comments closed', 'wpex')); ?></li>
<?php } ?>
<li><i class="icon-user"></i><?php the_author_posts_link(); ?></li>
</ul><!-- .meta -->
<?php get_template_part('content', get_post_format() ); ?>
<?php } ?>
<article class="entry clr">
<?php the_content(); ?>
</article><!-- /entry -->
<?php
// Post pagination
wp_link_pages( array( 'before' => '<div class="page-links clr">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
<?php
// Tags
if ( of_get_option( 'blog_tags', '1' ) ) { ?>
<?php the_tags('<div class="post-tags clr">','','</div>'); ?>
<?php } ?>
<?php
// Author bio
if ( of_get_option('blog_bio', '1' ) && get_the_author_meta( 'description' ) ) { ?>
<?php get_template_part( 'author-bio' ); ?>
<?php } ?>
<?php
// Related posts
if ( of_get_option('blog_related', '1' ) ) { ?>
<?php get_template_part( 'content', 'related-posts' ); ?>
<?php } ?>
<?php comments_template(); ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php endwhile; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

کد

image-default-sizes.php


<?php
/**
* Creates a function for your featured image sizes which can be altered via your child theme
*
* @package WordPress
* @subpackage Pytheas
* @since Pytheas 1.0
*/

if ( ! function_exists( 'wpex_img' ) ) :
function wpex_img($args){
//slider
if( $args == 'slider_width' ) return '1040';
if( $args == 'slider_height' ) return '400';
if( $args == 'slider_crop' ) return true;
//blog home entries
if( $args == 'blog_home_entry_width' ) return '700';
if( $args == 'blog_home_entry_height' ) return '350';
if( $args == 'blog_home_entry_crop' ) return true;
//blog entries
if( $args == 'blog_entry_width' ) return '700';
if( $args == 'blog_entry_height' ) return '350';
if( $args == 'blog_entry_crop' ) return true;
//blog related entries
if( $args == 'blog_related_entry_width' ) return '700';
if( $args == 'blog_related_entry_height' ) return '350';
if( $args == 'blog_related_entry_crop' ) return true;
//blog post
if( $args == 'blog_post_width' ) return '150';
if( $args == 'blog_post_height' ) return '150';
if( $args == 'blog_post_crop' ) return true;
//portfolio entries
if( $args == 'portfolio_entry_width' ) return '700';
if( $args == 'portfolio_entry_height' ) return '350';
if( $args == 'portfolio_entry_crop' ) return true;
//portfolio related entries
if( $args == 'portfolio_related_entry_width' ) return '700';
if( $args == 'portfolio_related_entry_height' ) return '350';
if( $args == 'portfolio_related_entry_crop' ) return true;
//portfolio post
if( $args == 'portfolio_post_width' ) return '700';
if( $args == 'portfolio_post_height' ) return '350';
if( $args == 'portfolio_post_crop' ) return true;
//service post
if( $args == 'service_post_width' ) return '700';
if( $args == 'service_post_height' ) return '350';
if( $args == 'service_post_crop' ) return true;
}
endif;

با تشکر

ویرایش شده توسط areg
لینک به ارسال

شما باید از طریق css طول و عرض دلخواه رو به تصاویر بدید :

این بخش thumbnail قالبتون هست


/*post-thumbnail*/
#post-thumbnail { display: block; border: 1px solid #ddd; margin-bottom: 20px; }
#post-thumbnail img { width: 100%; display: block; padding: 3px; background: #eee; border: 1px solid #fff; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
#post-thumbnail img:hover { opacity: 0.8; -moz-opacity: 0.8; -webkit-opacity: 0.8; }

  • امتیاز 4
لینک به ارسال

اگر منظورتون از تصاویر شاخص ادامه ی مطلب تصاویر شاخص مطالب مشابه است؟


if( $args == 'blog_related_entry_width' ) return '700';
if( $args == 'blog_related_entry_height' ) return '350';

را ویرایش کنید

و اگر منظورتون تصاویر شاخص مربوط به داخل مطلب است


if( $args == 'blog_post_width' ) return '150';
if( $args == 'blog_post_height' ) return '150';

و اگر تصاویر اصلی مطلب


if( $args == 'blog_entry_width' ) return '700';
if( $args == 'blog_entry_height' ) return '350';

بعد از اینکار ممکنه در استایل هم تغییراتی لازم باشه که قالب به هم نخوره که فرمودند

  • امتیاز 5
لینک به ارسال

لطفا برای ارسال دیدگاه وارد شوید

شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید



ورود به حساب کاربری
×
×
  • اضافه کردن...