Featured Image Questions


Hi,

On this site (https://www.great-days-out.co.uk) we are using featured images on a load of pages. However, the featured images aren't of the same quality as the actual images, the featured image ends in a weird url, for instance, https://www.great-days-out.co.uk/wp-content/uploads/beans/images/Days-Out-in-Nottinghamshire-ed73be6.jpg and the image is being pulled from the beans media library rather than the main Wordpress one. Is there a way for the image to be better quality and the url pattern to change?

Below is my functions.php file, let me know if you need any more code.

<?php

// Include Beans. Do not remove the line below.
require_once( get_template_directory() . '/lib/init.php' );

/*
 * Remove this action and callback function if you do not whish to use LESS to style your site or overwrite UIkit variables.
 * If you are using LESS, make sure to enable development mode via the Admin->Appearance->Settings option. LESS will then be processed on the fly.
 */
add_action( 'beans_uikit_enqueue_scripts', 'beans_child_enqueue_uikit_assets' );

function beans_child_enqueue_uikit_assets() {

  beans_compiler_add_fragment( 'uikit', get_stylesheet_directory_uri() . '/style.less', 'less' );

}

// Remove this action and callback function if you are not adding CSS in the style.css file.
add_action( 'wp_enqueue_scripts', 'beans_child_enqueue_assets' );

function beans_child_enqueue_assets() {

  wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' );

 wp_enqueue_style( 'modal_style', get_template_directory_uri() . '/lib/assets/css/jquery.modal.css',false,'1.1','all');

}

function add_modal_script() {
    wp_register_script('modal_script', home_url() . '/wp-content/themes/quoakle2017/lib/assets/jquery/jquery.modal.min.js', array( 'jquery' ));
    wp_enqueue_script('modal_script');
}  

add_action( 'wp_enqueue_scripts', 'add_modal_script' );

// Remove the site title and site title tag.
beans_remove_action( 'beans_site_title_tag' );

// Move menu below header.
beans_modify_action_hook( 'beans_primary_menu', 'beans_header_after_markup' );

// Remove float and add container.
beans_remove_attribute( 'beans_primary_menu', 'class', 'uk-float-right' );
beans_wrap_markup( 'beans_primary_menu', 'example_primary_menu', 'div', array( 'class' => 'uk-container uk-container-center' ) );

add_action( 'widgets_init', 'example_widgets_init' );

function example_widgets_init() {

    // Create 3 widget area.
    for( $i = 1; $i <= 4; $i++ ) {
        beans_register_widget_area( array(
            'name' => "Footer Area {$i}",
            'id' => "footer_widget_area_{$i}",
        ) );
    }

}

// Output widget area above the footer.
add_action( 'beans_footer_before_markup', 'example_footer_widget_area' );

function example_footer_widget_area() {

    ?>
    <div class="footer uk-block">
        <div class="uk-container uk-container-center">
            <div class="uk-grid uk-grid-width-medium-1-4" data-uk-grid-margin>
                <?php for( $i = 1; $i <= 4; $i++ ) : ?>
                    <div><?php echo beans_widget_area( "footer_widget_area_{$i}" ); ?></div>
                <?php endfor; ?>
            </div>
        </div>
    </div>
    <?php

}

// Disable comments on pages.
add_action( 'init', 'example_remove_page_comments' );

function example_remove_page_comments() {

  remove_post_type_support( 'post', 'comments' );

  remove_post_type_support( 'page', 'comments' );

}

beans_add_attribute( 'example_primary_menu', 'class', 'menu' );

add_action( 'widgets_init', 'example_widgets_init' );

// Move menu below header.
beans_modify_action_hook( 'beans_post_image', 'beans_content_before_markup' );

if (is_page('blog')) {
  beans_remove_attribute( 'beans_post', 'class', 'uk-panel-box' );
}

// Register new Footer Menu
add_action( 'init', 'j0e_register_my_menu' );

function j0e_register_my_menu() {
    register_nav_menu( 'footer-menu',__( 'Footer Menu' ) );
}
// Overwrite the footer credit and add the footer menu for contact, privacy...
beans_add_smart_action( 'beans_footer_credit_right_text_output', 'j0e_footer_menu' );

function j0e_footer_menu() {

wp_nav_menu( array( 
    'menu' => 'Footer Menu',
    'menu_class' => 'uk-subnav uk-subnav-line uk-contrast',
    'theme_location' => 'footer-menu',
    'beans_type' => 'navbar'
) );
}

beans_remove_attribute( 'beans_menu[_navbar][_footer-menu]', 'class', 'uk-navbar-nav' );

/* LEFT text: Modify "© 2016 - Beans Framework test. All rights reserved." */
add_action( 'beans_footer_credit_text_output', 'hyperindian_right_copyright' );
function hyperindian_right_copyright() {
    // Add your copyright html text, Dynamic date and times etc something like .
    ?><p>© Quoakle 2012 - <?php echo date("Y"); ?> | <a href="/">Great Days Out UK</a> </p><?php
}

function print_menu_shortcode($atts, $content = null) {
    extract(shortcode_atts(array( 'name' => null, ), $atts));
    return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) );
}
add_shortcode('menu', 'print_menu_shortcode');

// Hide Instagram Captions

function custom_instagram_settings($code){
    if(strpos($code, 'instagr.am') !== false || strpos($code, 'instagram.com') !== false){ // if instagram embed
        $return = preg_replace("@data-instgrm-captioned@", "", $code); // remove caption class
        return $return;     
    }
return $code;
}

add_filter('embed_handler_html', 'custom_instagram_settings');
add_filter('embed_oembed_html', 'custom_instagram_settings');

add_filter( 'beans_edit_post_image_args', 'example_post_image_edit_args' );

function example_post_image_edit_args( $args ) {

    return array_merge( $args, array(
        'resize' => array( 940, 300, true ),
    ) );

}

// Remove offcanvas menu.
remove_theme_support( 'offcanvas-menu' );

Thanks in advance


Hey Timo,

Here is a thread regarding the image quality. Alternatively, you may let WordPress "new" image resize handle the images by disabling Beans Image handling:

// Let WordPress handle the image sizes.
add_filter( 'beans_post_image_edit', '__return_false' );

Happy coding,

Write a reply

Login or register to write a reply, it's free!