• Resolved laurenandchris

    (@laurenandchris)


    Hello,
    I want to make the $ contribution amount above the progress bar a smaller size, so it is the same size as the smaller text next to it (eg. the text that reads the fundraising goal).

    How can I make this all the one smaller size?

    Thank you so much! This plugin is brilliant!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Devin Walker

    (@dlocc)

    Hi @laurenandchris – this can be achieve with some minor CSS edits. I can help you change the size if you provide a link to your website where the donation form is displaying. Thanks!

    Thread Starter laurenandchris

    (@laurenandchris)

    Hi Devin, thank you for your help!

    The site isn’t open / it’s closed for viewing while in development… am I able to provide you with the styling info you may need to form the code? Eg. do you need to just know the text size / font of the text I am wanting to match?

    If so, it is Lato, size 13, black color.

    Is this enough info for styling the dollar amount text to match the writing alongside it?

    Thank you so much for your help!!

    Plugin Author Devin Walker

    (@dlocc)

    Hey @laurenandchris – No problem. I’m guessing that this is what you’re looking for:

    
    .give-form .give-goal-progress .income {
       font-size: 16px; 
    }
    

    Just adjust the font size to match the size of the text next to it.

    Thread Starter laurenandchris

    (@laurenandchris)

    Hi Devin,
    Thank you for your reply! I tried this code and similar to the issue I was having with the other code, when I add it into the Custom Functions plugin, it says “Sorry, but your code causes a “Fatal error”, so it is not applied! Please, check the code and try again.”

    Given this has happened with both codes, I’m thinking I’m doing something wrong.

    Lines 1 – 12 of my Custom Functions PHP code are:

    function my_give_text_switcher( $translations, $text, $domain ) {
    // changes the “Donations” text in multiple places
    if ( $domain == ‘give’ && $text == ‘%1$s of %2$s raised’ ) {
    $translations = __( ‘%1$s of %2$s’, ‘give’ );
    }

    if ( $domain == ‘give’ && $text == ‘Donation Total:’ ) {
    $translations = __( ‘Your Total:’, ‘give’ );
    }
    return $translations;
    }
    add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );

    When I go to add new code in, do I just add it to the line below? Do I leave any space? Is there anything I have to do when copying this new code into the Custom Functions PHP?

    Thank you!!!

    Plugin Author Devin Walker

    (@dlocc)

    The issue is you need to give each function a unique name. If you add a function with the same name it will cause a fatal error. Change my_give_text_switcher to my_give_text_switcher_1 in ALL places. Then add then new function we gave you and name it my_give_text_switcher_2 in ALL places. This will prevent the fatal error.

    Thread Starter laurenandchris

    (@laurenandchris)

    Hi Devin,

    Sorry… I’m a little confused. The long code I pasted above is what’s in here currently and has worked find to change the wording.

    When I pasted this code below, it then created a fatal error…

    .give-form .give-goal-progress .income {
    font-size: 16px;
    }

    When I also paste in the other text provided to change the email header, it creates a fatal error…

    function my_give_text_switcher( $translations, $text, $domain ) {

    if ( $domain == ‘give’ && $text == ‘Donation Receipt’ ) {
    $translations = __( ‘Receipt’, ‘give’ );
    }

    return $translations;
    }
    add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );

    I just don’t know what to do! I am pasting in exactly the code provided. Are you able to combine them for me so I can know exactly what to put in my Custom Functions PHP code to achieve all three outcomes?

    I would be so so so grateful for your help, I’ve been struggling with this for a week!

    Thank you!

    Plugin Author Devin Walker

    (@dlocc)

    The two codes I provided are different. One is PHP, the other is CSS. You can ONLY paste PHP within the Custom Functions plugin. Not CSS.

    CSS:

    .give-form .give-goal-progress .income {
       font-size: 16px; 
    }

    This belongs in your theme’s stylesheet. Please carefully read over: https://givewp.com/documentation/resources/handling-custom-css-in-wordpress/

    PHP:

    function my_give_text_switcher( $translations, $text, $domain ) {
    // changes the “Donations” text in multiple places
    if ( $domain == ‘give’ && $text == ‘%1$s of %2$s raised’ ) {
    $translations = __( ‘%1$s of %2$s’, ‘give’ );
    }
    
    if ( $domain == ‘give’ && $text == ‘Donation Total:’ ) {
    $translations = __( ‘Your Total:’, ‘give’ );
    }
    return $translations;
    }
    add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );
    

    This DOES belong in the my custom functions plugin or another custom functionality plugin. Please carefully read over: https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/

    If you have trouble after reading over both I feel you should consult with a developer as it’s very difficult for me to keep providing advice as to which code goes where back and forth. Thank you for your understanding.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Donation Bar $ Amount Text Size’ is closed to new replies.