Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Portfolio Slideshow Image Size

    • 10 years ago Bikul
      Participant

      Expired

      Hello,

      a few weeks ago I created portfolio items with Container Slider above the content.

      Pictures were showing 960 x 640 px.
      If I create a portfolio item now with the same style the pictures show with 960 x 390 px.

      I dont know why that is. Did change something in the template with an update or what can I do?

      As the site is not available for the public yet, I could give you login if you like to take a look.

      Thanks for Feedback
      Bernd

    • 10 years ago Mirela
      Participant

      Hello,

      Please go to file functions.php in Specular theme folder and find these lines:

      function codeless_images_sizes(){
          
          add_image_size( 'port3', 600, 600, true ); 
         
          add_image_size( 'port3_grayscale', 627, 470, true );
          add_image_size( 'port2', 460, 275, true );
          add_image_size( 'port2_grayscale', 940, 470, true );
          add_image_size( 'port4', 600, 600, true );

      Here are all sizes of all portfolio/blog types. Edit the dimensions of image at the specific portfolio type you are using, or add a new one if it doesn’t exists. After this, import again the images and run a plugin that recreates thumbnails.
      Let us know if you need help.

      Best regards!

      • This reply was modified 10 years ago by Mirela.
    • 9 years, 11 months ago Bikul
      Participant

      Expired

      Hello Mihaila,

       

      as I use the child-theme of Specular, could I embed the altered code for this in functions.php of the child theme?

      Like this:

      <?php

      Function child_enqueue_scripts() {

      wp_register_style( ‘childtheme_style’, get_stylesheet_directory_uri() . ‘/style.css’  );

      wp_enqueue_style( ‘childtheme_style’ );

      }

      add_action( ‘wp_enqueue_scripts’, ‘child_enqueue_scripts’);

      function codeless_images_sizes(){

      add_image_size( ‘port3’, 600, 600, true );

      add_image_size( ‘port3_grayscale’, 627, 470, true );

      add_image_size( ‘port2’, 460, 275, true );

      add_image_size( ‘port2_grayscale’, 940, 470, true );

      add_image_size( ‘port4’, 600, 600, true );

       

      add_image_size( ‘blog’, 960, 640, true );

      add_image_size( ‘alternate_blog’, 440, 195, true );

      add_image_size( ‘alternate_blog_side’, 355, 235, true );

      add_image_size( ‘blog_grid’, 350, 350, true );

       

      add_image_size( ‘staff’, 400, 270, true );

      add_image_size( ‘staff_full’, 500, 340, true );

      }

       

      ?>

      So I would not have to make these changes everytime I update the theme?

      Thank you for Help!
      Bernd

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      Sorry for the late reply.
      Yes, that should be good.

      Best regards!

    • 9 years, 11 months ago Bikul
      Participant

      Expired

      If I add the code like that:

      <?php

      Function child_enqueue_scripts() {

      wp_register_style( ‘childtheme_style’, get_stylesheet_directory_uri() . ‘/style.css’  );

      wp_enqueue_style( ‘childtheme_style’ );

      }

      add_action( ‘wp_enqueue_scripts’, ‘child_enqueue_scripts’);

      function codeless_images_sizes(){

      add_image_size( ‘port3’, 600, 600, true );

      add_image_size( ‘port3_grayscale’, 627, 470, true );

      add_image_size( ‘port2’, 460, 275, true );

      add_image_size( ‘port2_grayscale’, 940, 470, true );

      add_image_size( ‘port4’, 600, 600, true );

      add_image_size( ‘blog’, 960, 640, true );

      add_image_size( ‘alternate_blog’, 440, 195, true );

      add_image_size( ‘alternate_blog_side’, 355, 235, true );

      add_image_size( ‘blog_grid’, 350, 350, true );

      add_image_size( ‘staff’, 400, 270, true );

      add_image_size( ‘staff_full’, 500, 340, true );

      }

      ?>

       

      I get this failure:

      <b style=”color: #000000; font-family: Times; line-height: normal;”>Fatal error</b><span style=”color: #000000; font-family: Times; font-size: medium; line-height: normal;”>: Cannot redeclare codeless_images_sizes() (previously declared in /www/htdocs/w00fc17a/destino-creative.de/wp-content/themes/specular-child/functions.php:16) in </span><b style=”color: #000000; font-family: Times; line-height: normal;”>/www/htdocs/w00fc17a/destino-creative.de/wp-content/themes/specular/functions.php</b><span style=”color: #000000; font-family: Times; font-size: medium; line-height: normal;”> on line </span><b style=”color: #000000; font-family: Times; line-height: normal;”>162</b>

       

      What to do?

      Thank you
      Bernd

    • 9 years, 10 months ago Ruco
      Keymaster

      Hello,

      I suggest you to keep the changes at parent theme and update only the changes file on each theme update.

      The image sizes can’t be declared at child theme.

      Or you can specify the image size directly at portfolio or blog file.
      Ex. Replace this:

      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port4', 'url')) ?>" alt="">

      with:

      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), array(250, 250), 'url')) ?>" alt="">

      Best regards!

Viewing 5 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password