WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP-chgFontSize] Does not update on page switch (4 posts)

  1. Mark
    Member
    Posted 4 years ago #

    Cookies are set alright, and I think they're even read, but the fontsize is not reapplied when switching to another page; instead, page is loaded at default fontsize.

    I think the cookie is read nonetheless because the state of the buttons depends on the setting, and if I scale up to max size (deactivating the button) and then load another page, button stays deactivated but size is back to normal.

    http://wordpress.org/extend/plugins/wp-chgfontsize/

  2. Mark
    Member
    Posted 4 years ago #

    So what this plugin lacks is a call in the footer that updates the font size after rendering the page.

    Add the following code to your functions.php to fix this:

    // WP chFontSize footer function
    function footer_chgfontsize_js() { ?>
    <script type="text/javascript">
    	chgFontSize_change(chgfontsize_font_size);
    </script>
    
    <?php }
    add_action('wp_footer', 'footer_chgfontsize_js');

    You can also edit the plugin's PHP file but then you would lose this customization upon updating the plugin (a hypothetic situation since the author seems to have discontinued it).

  3. pixelmonger
    Member
    Posted 3 years ago #

    This is a cool plugin and the above makes it work correctly :)

  4. pixelmonger
    Member
    Posted 3 years ago #

    What would be cool is if you could independently specify DIV id's, multiple DIV's, or element classes

Topic Closed

This topic has been closed to new replies.

About this Topic