• Resolved HELLAWYER

    (@hellawyer)


    Hi again…I still can’t find the file where I can change the size of images, so I can paste into the follow code:

    add_action(“init”, “my_adverts_image_sizes”, 20);
    function my_adverts_image_sizes() {
    // remove default image sizes
    remove_image_size(“adverts-upload-thumbnail”);
    remove_image_size(“adverts-list”);
    // add them again with different dimensions
    add_image_size( “adverts-upload-thumbnail”, 150, 105, true );
    add_image_size( “adverts-list”, 300, 190, true);

    There are 2 same files. The first file “functions.php” I found is in the theme’s folder, the other is in WPAdverts folder. Which one is the right? But my true problem is that I dont want actually to resize the images, but I just dont want them cropped. I tried many WP themes, but always the images are cropped. How can I solve this problem? I am still a beginner, so I would be happy if you can tell me exactly where the file is, and what exactly I have to change in there. Thanks again

    https://wordpress.org/plugins/wpadverts/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    You should paste it in theme functions.php or even better create a new plugin and paste the code there.

    Also, the code itself you need to customize to your needs, by default the images are cropped, you need to set fourth param in add_image_size() to false, see https://developer.wordpress.org/reference/functions/add_image_size/

    Thread Starter HELLAWYER

    (@hellawyer)

    Unlucky I cant find the code that I have to change for to false. Dont know in which file I can find it. Surely it is not in functions.php.
    Also I added in the theme’s function.php the code above to enlarge image size. Again without succes.
    Is there a way to display the pictures without the slider? It would be nice if we could install for example a plugin ex. gallery plugin. I tried that also, but it doesnt work at advert.
    My site is http://www.greek-chopper.eu . When somebody clicks on an item, he cant see the hole image. Just a cropped one..
    Thanks for ur help

    Plugin Author Greg Winiarski

    (@gwin)

    This is beyond support to be honest, you need some PHP knowledge to do it, open your theme functions.php and paste there following code

    add_action("init", "my_adverts_image_sizes", 20);
    function my_adverts_image_sizes() {
        // remove default image sizes
        remove_image_size("adverts-upload-thumbnail");
        remove_image_size("adverts-list");
        // add them again with different dimensions
        add_image_size( "adverts-upload-thumbnail", 150, 105, true );
        add_image_size( "adverts-list", 300, 190, false);
    }

    Note in the code snippet i changed line add_image_size( "adverts-list", 300, 190, true); to add_image_size( "adverts-list", 300, 190, false); this disables image cropping on ads list.

    But this is not all, WP on image uploaded creates all the image sizes, so as described in document i linked to earlier you need use this plugin https://wordpress.org/plugins/regenerate-thumbnails/ to regenerate all images.

    Thread Starter HELLAWYER

    (@hellawyer)

    Thanks a lot.Problem solved.I had just to change the width of rslides

    HELLAWYER would it be possible to know everything you did to get the plugin working correctly? I see everything is displayed perfectly on your site. At the moment the photos on the adverts list page and main page are cropped rather than showing resized versions, this makes it impossible to see what is being advertised. It seems you had the same problem before.

    I added the code above to my functions.php file in my theme directory and it doesn’t work, I even tested the code with the default wordpress theme. πŸ™

    Thread Starter HELLAWYER

    (@hellawyer)

    login via ftp
    go to
    1) wp-content
    2) Plugins
    3) wp-adverts
    4) assets
    5) css
    there you’ll find a file called ” adverts-frontend.css”
    open it with Notepad++
    somewhere at line 620 (I think), you can change the height and width of the slider

    Thank you for your help :), with your help and the help of another member I now have the advert listings looking much better. Now I just need to work out how to stop the main adverts page from cropping the images.

    Thread Starter HELLAWYER

    (@hellawyer)

    Change it the same way…. You have to make changes in the same file. I dont remember exactly which line (look for with and height rslide1).Look at my website, I mean at the main adverts page, the images are not cropped.
    You can also copy and paste this from line 599 to 703:

    rslides {
      margin: 0 auto;
      padding: 0;
    }
    
    .rslides img {
        border: none !important;
        box-shadow: none !important;
    
        position: absolute;
        top: -9999px;
        bottom: -9999px;
        left: -9999px;
        right: -9999px;
        margin: auto;
    }
    
    .rslides li {
        list-style-type: none !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        height: 750px;
        overflow: hidden;
        background-color: #e3e1e2;
        border: 1px solid whitesmoke;
        text-align: center;
        vertical-align: middle;
    }
    
    .rslides_container {
      margin: 0 0 2em 0;
      position: relative;
      float: left;
      width: 100%;
      clear: both;
      overflow:hidden;
      }
    
    .rslides1_nav {
      position: absolute;
      -webkit-tap-highlight-color: rgba(0,0,0,0);
      top: 50%;
      left: 0;
      z-index: 99;
      opacity: 0.7;
      text-indent: -9999px;
      overflow: hidden;
      text-decoration: none;
      height: 61px;
      width: 38px;
      background: transparent url("themes.gif") no-repeat left top;
      margin-top: -45px;
      }
    
    .rslides1_nav:active {
      opacity: 1.0;
      }
    
    .rslides1_nav.next {
      left: auto;
      background-position: right top;
      right: 0;
      }
    
    .rslides1_nav:focus {
      outline: none;
      }
    
    .rslides_tabs {
      margin-top: 10px;
      text-align: center;
      }
    
    .rslides_tabs li {
      display: inline;
      float: none;
      _float: left;
      *float: left;
      margin-right: 5px;
      }
    
    .rslides_tabs a {
      text-indent: -9999px;
      overflow: hidden;
      -webkit-border-radius: 15px;
      -moz-border-radius: 15px;
      border-radius: 15px;
      background: #ccc;
      background: rgba(0,0,0, .2);
      display: inline-block;
      _display: block;
      *display: block;
      -webkit-box-shadow: inset 0 0 2px 0 rgba(0,0,0,.3);
      -moz-box-shadow: inset 0 0 2px 0 rgba(0,0,0,.3);
      box-shadow: inset 0 0 2px 0 rgba(0,0,0,.3);
      width: 9px;
      height: 9px;
      }
    
    .rslides_tabs .rslides_here a {
      background: #222;
      background: rgba(0,0,0, .8);
      }

    It now looks perfect. Thank you once again for your help and Merry Christmas :o)

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘crop images’ is closed to new replies.