Forums

[resolved] Custom Post Type on Home Page with different width (4 posts)

  1. 50020
    Member
    Posted 5 months ago #

    Hi,

    I have created a 'custom_post_type', and as default these don't show up on the home/blog page. I know how to get them to show up and there is an excellent tutorial here

    but my custom post page is a full width [960px] page to display an image. My blog posts are narrower [600px].

    How would I begin to resize any images that are wider than 600px in the custom_post_type to a max of 600px, so that when a blog list (or category, tag, search etc) is displayed, that the large images are displayed smaller and that the 'design' of the blog is not broken?

    many thanks

    Steven

  2. alchymyth
    The Sweeper
    Posted 5 months ago #

    does your theme use post_class() and/or body_class() ?

    these might output custom post type specific css classes (not tested) which you could use in style.css to re-scale the large images.

    a link to your site might help to check this.

  3. 50020
    Member
    Posted 5 months ago #

    Thanks for the reply;

    As of yet, I am still customising the theme, so is being done locally.

    here is a screen grab of the full width custom-type post

    Full Width

    and a normal size post

    Normal width

    as you can see the full width has broken the design....

    and a search through the theme files shows that post_class() is not used.

    ** edit** post_class() is used

    but body_class() is not.

    I have never used post_class in my basic use of wordpress in the past, and I'll look it up - but if there is something obvious that I can do to achieve this, it would be much appreciated...

    regards

  4. 50020
    Member
    Posted 5 months ago #

    Cracked it!

    Thanks alchymyth for pointing me in the direction of post_class().....

    I have used the css

    .photo img 	{ outline:#DDD solid thin; background-color: #EEE; padding: 4px; max-width: 580px ; max-height:580px;}

    where .photo relates to the post-type and I style the IMG's within that type of post...

    to style the post entry. If there is a better option to resize the photos in the post, I will be very glad to hear...but this appears to work in the latest Chrome and Firefox browsers....

    regards

Reply

You must log in to post.

About this Topic