• Resolved Sagano

    (@sagano)


    Hello,

    turns out I have yet another question for you. How can I display my badges in a bigger size at the top of my achievements?

    I’ve decided not to send my users to Credly to view their badges, so I would like for the badges to be displayed large enough for people to be able to read the text on the badge. I suppose I could make all badges text-free, but I’d rather make them bigger ??

    https://www.ads-software.com/plugins/badgeos/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    CSS is one option. Depending on what functionality/code is being used to generate the spots you’re referring to, it may be possible to filter what size of image to use, allowing you to specify a larger version. You’d need to poke through the code for that or let me know what you’re using to display the section and I can do a quick check myself.

    Thread Starter Sagano

    (@sagano)

    I’m not sure which CSS-file to poke through, or which words to search for… I sifted through the front.css looking for words like “badge”, “image”, “size”, but I don’t think I found what I was looking for.

    So your help would be much appreciated! Does a link to my site suffice or how do I let you know how my site displays the section?

    Here’s a link to a page on my site where I would like the badge to be bigger: https://bitfrbit.se/mat/avsta-flaskvatten-drick-kranvatten/

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re not going to want to edit our CSS anyway, you’re going to want to override the CSS in your own location, likely through your theme. I’m guessing you’re not all that familiar with your browsers developer tools.

    Add this to your functions.php file and see if it returns better results.

    function sagano_badge_size( $size ) {
    	if ( 'badgeos-achievement' == $size ) {
    		return 'large';
    	}
    
    	return $size;
    }
    add_filter( 'post_thumbnail_size', 'sagano_badge_size' );

    If all goes well, it’ll return the large version of the image instead of our badgeos-achievement version.

    Thread Starter Sagano

    (@sagano)

    You’re right, I’m not that familiar with the terminology or much else that has to do with developing websites, yet. But you have to start somewhere! Thank you for being patient with me.

    It all works fine now ??

    Thread Starter Sagano

    (@sagano)

    If I want the small badgeos-achievement size on my “earned user achievements”-page, is there another piece of code I should add to my functions.php then? I suppose I shouldn’t try to change that either in the BadgeOS front.css.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    You could amend my snippet above to add more conditions of when to change the specified size. Do a global $post call and check the current page with that $post object and return conditionally based on that as well.

    I’d need to tinker and test to get the exact code example worked out though.

    Thread Starter Sagano

    (@sagano)

    I don’t quite understand what you just said I should do, but I will read through the wordpress codex more thoroughly and then I’ll make a try.

    If you have the time, that tinkering and testing would be greatly appreciated, but if you don’t I’ll figure it out myself eventually ??

    Thread Starter Sagano

    (@sagano)

    I realized I could just use the earned achievements-widget, since that still shows the badges in a small size. Thanks for all your help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Make badges bigger’ is closed to new replies.