• i added latest posts in the sidebar and the images it displays is the widget-thumb. is there any way to change the widget-thumb size or proportions, or to display a regular thumbnail.
    thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter zs33

    (@zs33)

    i mean the 80x50px image just for clarity

    If you use a child theme you can add this to your child themes functions.php file:

    remove_action('after_setup_theme', 'kadence_setup');
    function kadence_setup_custom() {
    
      register_nav_menus(array(
        'primary_navigation'    => __('Primary Navigation', 'virtue'),
        'secondary_navigation'  => __('Secondary Navigation', 'virtue'),
        'mobile_navigation'     => __('Mobile Navigation', 'virtue'),
        'topbar_navigation'     => __('Topbar Navigation', 'virtue'),
        'footer_navigation'     => __('Footer Navigation', 'virtue'),
      ));
    
      add_theme_support('post-thumbnails');
      add_image_size( 'widget-thumb', 80, 80, true );
      add_post_type_support( 'attachment', 'page-attributes' );
      add_theme_support( 'automatic-feed-links' );
      add_editor_style('/assets/css/editor-style.css');
    }
    add_action('after_setup_theme', 'kadence_setup_custom');

    That will remove the parent theme after setup and add your custom stuff. It will make the widget thumb 80×80

    Kadence Themes

    Thread Starter zs33

    (@zs33)

    thanks for the reply!
    i have just created a functions.php file:

    <?php
    remove_action('after_setup_theme', 'kadence_setup');
    function kadence_setup_custom() {
      register_nav_menus(array(
        'primary_navigation'    => __('Primary Navigation', 'virtue'),
        'secondary_navigation'  => __('Secondary Navigation', 'virtue'),
        'mobile_navigation'     => __('Mobile Navigation', 'virtue'),
        'topbar_navigation'     => __('Topbar Navigation', 'virtue'),
        'footer_navigation'     => __('Footer Navigation', 'virtue'),
      ));
    
      add_theme_support('post-thumbnails');
      add_image_size( 'widget-thumb', 80, 80, true );
      add_post_type_support( 'attachment', 'page-attributes' );
      add_theme_support( 'automatic-feed-links' );
      add_editor_style('/assets/css/editor-style.css');
    }
    add_action('after_setup_theme', 'kadence_setup_custom');
    ?>

    and i get this error:
    Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in functions.php on line 6

    i dont really know much about functions.php. nothing to be exact ?? so what am i doing wrong?

    That is al you have in your child theme functions file correct? you copied from here and not an email right? Is there anything else in your child theme?

    You can leave off the end ?>

    Kadence Themes

    Thread Starter zs33

    (@zs33)

    so i did it again and this time no error, but nothing is happening.

    this is all i have in the functions.php and copied it from here.

    other than that i have a style.css with this inside:

    /* Theme Name:   virtue-Child
     Description:  virtue child theme
     Author:       ZS
     Template:     virtue
     Version:      1.0.0
    */
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
    );
    }

    Thread Starter zs33

    (@zs33)

    with and without ?> makes no difference

    Your style sheet shouldn’t have PHP…

    Remove all this:

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
    );
    }

    You don’t need that anyway.

    Now once the function is in you just have to regenerate your thumbnails. Use this plugin: https://www.ads-software.com/plugins/regenerate-thumbnails/

    Kadence Themes

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘widget-thumb size’ is closed to new replies.