• Resolved kentannenbaum

    (@kentannenbaum)


    I have a sharpness issue with uploaded photos that are already sized correctly.

    I’ve gotten advice about what code to insert. The question is: do I access the theme content functions:php in the FILE MANAGER at the host site OR is it entered from the DASHBOARD > Appearance > theme > functions:php

    Thanks very much. Ken

Viewing 9 replies - 1 through 9 (of 9 total)
  • Dashboard>appearance>editor>functions.php would be THE SAME as File Manager> /wp-content/themes/*active_theme*/functions.php

    EDITED: Good call by @questas_admin … Use a child theme or a custom css feature via plugin instead of editing directly the active theme.

    David_G

    (@questas_admin)

    The best way to make changes like this to a theme is to use a child theme, so your tweaks won’t be overwritten when updating the theme. Here are some guides in case you haven’t made one before:
    https://codex.wordpress.org/Child_Themes
    http://op111.net/53/

    Thread Starter kentannenbaum

    (@kentannenbaum)

    Thanks very much. Ken

    David_G

    (@questas_admin)

    If you make a mistake with your functions.php file your site will likely go down, If you do it in a child theme, then all you need to do is rename the funtions file in your child theme to something else by FTP and your site will come back online, then you can figure out any mistakes.

    Thread Starter kentannenbaum

    (@kentannenbaum)

    Again, THANKS for the input. I’ll dig through it all. Back to my issue (besides the coding placement). What’s going on is a softness to SOME of my photos, all sized properly before upload at 600px x 72dpi. What’s been recommended in the forum are a couple of code solutions that remove the size attributes before upload which some coders think might solve the problem of softness. If anyone has a further opinion in this thread I’d love to hear it. Here are two suggestions I came across:
    FIRST SOLUTION:
    dd_filter( ‘post_thumbnail_html’, ‘remove_width_attribute’, 10 );
    add_filter( ‘image_send_to_editor’, ‘remove_width_attribute’, 10 );

    function remove_width_attribute( $html ) {
    $html = preg_replace( ‘/(width|height)=”\d*”\s/’, “”, $html );
    return $html;
    }

    SECOND SOLUTION:
    function gpp_jpeg_quality_callback($arg)
    {
    return (int)100;
    }

    add_filter(‘jpeg_quality’, ‘gpp_jpeg_quality_callback’);

    HERE’S MY SITE: http://kentannenbaum.com

    @kentannenbaum You might have better results if you mark this topic “entering code” as resolved, since we have discussed where to enter the code. Then create perhaps a new topic with more specific title like “need code to improve jpeg quality” … Good Luck

    Thread Starter kentannenbaum

    (@kentannenbaum)

    Good idea…I’ll do that. Thanks.

    You are welcome, please mark this topic resolved?

    And maybe also this one as it’s sort of a duplicate? : https://wordpress.org/support/topic/reduced-sharpness-of-images?replies=2

    Thread Starter kentannenbaum

    (@kentannenbaum)

    yes, thank you.

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

The topic ‘entering code’ is closed to new replies.