WordPress.org

Ready to get started?Download WordPress

Forums

Increase font size plugin (15 posts)

  1. jankdc
    Member
    Posted 7 years ago #

    I want to have a box in the corner to increase the text size in my site. I found the WP - Writing change [ fontsize and font ] plugin and am having trouble understanding how to install it. (I got the unzip and upload into plugin folder part). Can anyone help? Thanks!

  2. jankdc
    Member
    Posted 7 years ago #

    I am bumping this, I really want readers to be able to increase the font size on my website.

  3. Jonathan Landrum
    Member
    Posted 7 years ago #

    From the site, put one of these in your theme where you want the link:

    Beispiel-FontSize:

    <a href="fname('serif','content');">fontstyle serif auf das ID content</a>
    <a href="fname('Verdana','page');">fontstyle Verdana auf das ID page</a>

    This one seems to have two parameters: Font face, and div ID. (My German is a little shaky [nil], so if anyone cares to correct this...)

    Beispiel-FontStyle:

    <a href="fsize('1.2','em','content');">fontsize 1.2em auf das ID content</a>
    <a href="fsize('10','%','page');">fontsize 10% auf das ID page</a>

    This one appears to have three parameters: Value, units, and div ID.

  4. jankdc
    Member
    Posted 7 years ago #

    I put them into my theme and all I got were links that said

    fontstyle serif auf das ID content fontstyle Verdana auf das ID page fontsize 1.2em auf das ID content fontsize 10% auf das ID page

    that went nowhere.

  5. Jonathan Landrum
    Member
    Posted 7 years ago #

    Well, if you've got javascript enabled it shouldn't go anywhere, but should just change your font face/size. You can change the German text within the link to whatever you want them to say.

  6. jankdc
    Member
    Posted 7 years ago #

    thanks for the reply. how do I enable the javascript?

  7. Jonathan Landrum
    Member
    Posted 7 years ago #

    You enable javascript in your browser.

  8. jankdc
    Member
    Posted 7 years ago #

    That wasn't it. I have javascript enabled and it didn't fix the problem. I still got an error message.

    Not Found
    The requested URL /fname('serif','content'); was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  9. Jonathan Landrum
    Member
    Posted 7 years ago #

    I'd try contacting the plugin author, then. It might be a problem with their code. That, or see if there's another plugin that does the same thing (hopefully in English!)

  10. jwurster
    Member
    Posted 7 years ago #

    I think I understand what this is supposed to do. For the fname function, you pass it a font name like Palatino and the id that you wish it to be applied to, like Content. The fsize function takes a numeric size that corresponds to the second parameter units and then the third parameter is the id you wish it applied to.

  11. aquazero
    Member
    Posted 7 years ago #

    Most browsers already implement this. In Firefox, it's under View->Text Size.
    Nevertheless, this ought to work:

    <a href="javascript:void(0);" onclick="
    var fs = document.body.style.fontSize ;
    document.body.style.fontSize = (
    isNaN(parseFloat(fs))
    ? '18pt'
    : (parseFloat(fs) + 2) + fs.substring(parseFloat(fs).toString().length)
    );
    ">Increase Font Size</a>
    
    <a href="javascript:void(0);" onclick="
    var fs = document.body.style.fontSize;
    document.body.style.fontSize = (
    isNaN(parseFloat(fs))
    ? '18pt'
    : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length)
    );
    ">Decrease Font Size</a> 
    
    <a href="javascript:void(0);" onclick="
    document.body.style.fontSize = '18pt';
    ">Default Font Size</a>

    Change "18pt" in all links to font sizes better suited to your site as a default. Tested only in Firefox, and that with only a very simple DOM. You may want to add image instead of a text link.

    Cheers
    aquazero

  12. Doodlebee
    Member
    Posted 7 years ago #

    Alternatively, you could google "PHP stylesheet switcher", and you'll come up with a ton of stuff. That's really all you need.

  13. jankdc
    Member
    Posted 7 years ago #

    I tried using aquazero's recommendation, which worked but increased all of the font sizes including the title on the title page. Can I just increase the body and link? Also, what would work for adding a picture?

    I used

    <img src="http://www.spinalalignment.com/wp-content/uploads/Decrease%20Font%20Size.gif" align="right" onclick=" var fs = document.body.style.fontSize; document.body.style.fontSize = ( isNaN(parseFloat(fs)) ? '18pt' : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length) );" title="Increase Font size" /> <img src="http://www.spinalalignment.com/wp-content/uploads/Increase%20Font%20Size.gif" align="right" onclick=" var fs = document.body.style.fontSize; document.body.style.fontSize = ( isNaN(parseFloat(fs)) ? '18pt' : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length) );" title="Decrease Font size" />
    but it did some strange things (both images at first increased font size then would only decrease the font size.

    Thanks

  14. vkaryl
    Member
    Posted 7 years ago #

    Well, search google for the Batavia theme. It comes with a font sizer (a js file) and the code in the theme (not sure now which file it is, just have to look through it to find the relevant code) to implement it. It's not a "real" plugin, it's just an external js file and the head link to call it, plus the code in the theme to implement the upsize/downsize.

  15. aquazero
    Member
    Posted 7 years ago #

    makes the link description shorter and more presentable in example....

    <a href="javascript:void(0);" onclick="
    document.body.style.fontSize = '18pt';
    "><img src=" ./yourimage.jpg" /></a>

Topic Closed

This topic has been closed to new replies.

About this Topic