Need slight adjustment to this theme.....

Discussion in 'WordPress' started by nsta, Jul 25, 2012.

  1. #1
    Hi all,

    I really like this theme, but i need to know how i can make the featured image not height restricted for the blog posts....ie if the image is 1024x768, i would like to only resize the image width to fit the post dimensions (ie 700px, and then contrain proportions in height to fit the full frame into the post...so something like 700x430?

    In other words, i still want to be able to resize the image if its too large, but not cut the height off of it like its done so in these blogs posts below:

    http://www.themeskingdom.com/theme/widely/blog/

    What will i need to do on the theme to modify?

    Thanks,
     
    nsta, Jul 25, 2012 IP
  2. xInd

    xInd Notable Member

    Messages:
    2,025
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    225
    Digital Goods:
    2
    #2
    You should be able to just modify the part where it's calling the image in the theme's respective php file to reflect your layout. Do you have a fixed layout or does it mold to the user's screen? I recommend using a dynamic layout so that when people like me come around on 1080p the site looks nice, and also looks fine on old small monitors or mobile devices/tablets/netbooks etc.
    If you use all of your CSS with dynamic % sizing, then you can make sure the above problem doesn't happen either.
     
    xInd, Jul 25, 2012 IP
  3. nsta

    nsta Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank You,Sorry i am not very competent with CSS or coding much....i do try though...Is this something i can easily do myself if i was to provide you with the appropriate css script...or link to my site with the same theme on it?At this stage i would not like to have the image dynamically resized just fitting the pixel width i set it to....Is this easy to accomplish?
     
    nsta, Jul 25, 2012 IP
  4. nsta

    nsta Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ok here's the page.php.....

    <?php get_header();
    /**
    * @package WordPress
    * @subpackage Default_Theme
    */
    ?>


    <div class="posts-one-row">


    <?php
    $slug = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
    if ($_SERVER["SERVER_PORT"] != "80")
    {
    $slug .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    }
    else
    {
    $slug .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }


    if(!strpos($slug,'page')){
    $_SESSION['slug'] = $slug;
    }


    wp_reset_query();
    $slug = get_page_url();
    $pageslug = explode('page/',$slug);
    $pageslug = $pageslug[0];
    //The Loop
    $cellnum = 0;
    if ( have_posts() ) : while ( have_posts() ) : the_post();
    $data = get_post_meta( $post->ID, GD_THEME, true );
    $post_img = "";
    if (has_post_thumbnail()){
    $imagedata = simplexml_load_string(get_the_post_thumbnail());
    if(!empty($imagedata)){
    $post_img = $imagedata->attributes()->src;
    }
    }
    $title = the_title('','',FALSE);
    if ($title<>substr($title,0,40)){ $dots = "...";}else{$dots = "";}
    $cellnum++;
    ?>


    <?php
    $comments = get_comments("post_id=$post->ID");
    $num_of_comments = 0;
    foreach((get_the_category()) as $category) {
    $post_category = $category->cat_name;
    $post_category_id = $category->cat_ID;
    $cat_slug=get_cat_slug($post_category_id);
    }


    foreach($comments as $comm) :
    $num_of_comments++;


    endforeach;
    $written = $post->post_author;
    $user = get_user_by('id',$written);
    $written = $user->nickname;
    ?>


    <div class="blog-one-post">


    <div class="blog-post-title"><a href="<?php the_permalink(); ?>"><?php echo substr($title,0,165).$dots; ?></a></div>
    <?php if (has_post_thumbnail()) { ?>
    <div class="blog-page-image-holder">
    <div class="blog-page-image-center">
    <span class="blog-page-image">
    <a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri();?>/script/timthumb.php?src=<?php print $imagedata->attributes()->src;?>&w=804&h=242&zc=1&q=100" alt="<?php the_title(); ?>" class="hoverimg"/></a>
    </span>
    </div>
    </div><!--Ends blog-image-holder -->


    <?php }?>


    <div class="blog-info-holder">
    <div class="info-text"> <a href="<?php echo get_site_url().'/author/'.$written;?>"><img src="<?php echo get_template_directory_uri(); ?>/style/img/by.png" /><br /><?php echo $written; ?></a></div>
    <div class="info-text"><img src="<?php echo get_template_directory_uri(); ?>/style/img/calendar-post.png" /><br /><?php the_time('F');?> <?php the_time('d');?>, <?php the_time('Y');?></div>
    <div class="info-text"><a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/style/img/comments.png" /><br /><?php echo $num_of_comments; ?></a></div>
    </div>


    <div class="blog-content-holder">
    <div class="blog-post-text"><?php truncate_post(600);?></div>
    <a class="blog-cell_read_more" href="<?php the_permalink(); ?>">More</a>
    </div>


    <div class="clear-both"></div>
    <div class="post-separator"></div>
    <div class="clear-both"></div>
    </div><!--closes one_cell-->


    <?php endwhile; ?>


    <?php
    //activate pagination
    tk_pagination(1,5,5,$_SESSION['slug']); ?>
    <?php else: ?>
    <?php endif; ?>
    </div><!--close one row-->


    <?php get_footer(); ?>

    .....Now i presume its this part i need to modify? w=804&h=242&zc=1&q= 100?


    When i changed the h=242, to h=500 i was able to see more of the image vertically....but it also overlapped the txt in the blog post and also overlapped into the next blog post archive....?

    Does this help...
     
    nsta, Jul 26, 2012 IP