WordPress.org

Ready to get started?Download WordPress

Forums

WP doesn't pass my own URI parameters (7 posts)

  1. lxg
    Member
    Posted 9 years ago #

    Hi everybody,

    I installed a WordPress blog as a news section for my company's website. It works pretty fine, I really love it. I tuned it quite much to perfectly fit our corporate identity. However, our website has a feature to adapt font sizes at the push of a button. This is done by a URI parameter "fontsize" passing its value to the <body> tag where CSS font-size is set to $fontsize % (which is set to 93, if empty). As all size values are in em, it works perfectly – with all other pages of our website. Hope you can follow so far.

    The problem now is that even though I included all stuff from the normal sites, and all my own PHP works, WP doesn't process my URI parameters. I'm not the PHP superhero, but I can imagine two causes: First I could imagine that there is a definition for all common parameters while others are ignored, or second it could be that at a certain point all command line parameters are cleared or no further processed.

    So my question is: Why does WP "eat" my variables? How can I help it? Cause I need to have this damn resizing function.

    If you'd like to take a look yourselves:
    http://www.zirona.com/index.php, normal page
    http://www.zirona.com/news/index.php, my WP section

    If desired, I could provide the entire template source code as download.

    I hope this topic hasn't been discussed yet; but if it was I'd also be thankful for a link. TIA for your support.

    Alex

  2. lxg
    Member
    Posted 9 years ago #

    I forgot to say that you find the resizing function at the bottom of the left menu, described as "Schriftgröße", which is German for "font size". Obviously, pushing "+" increases, "-" decreases font size.

    Alex

  3. moshu
    Member
    Posted 9 years ago #

  4. lxg
    Member
    Posted 9 years ago #

    Maybe so, but only with JavaScript. I don't want JavaScript for several obvious reasons. Also, the site is supposed to be WCAG Triple-A. My font-size switcher is pure CSS.
    Beneath, my problem isn't only changing the font-size; I have to pass other parameters, too, e.g. language.

  5. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    I may be misinterpreting the question, but can't you use $_GET['fontsize']?

  6. Kafkaesqui

    Posted 9 years ago #

    My question as well. You say you're doing this by providing it in the url, but how are you collecting it to assign to $fontsize?

  7. lxg
    Member
    Posted 9 years ago #

    Thanks a lot, that solved my problem, the resizer works now. I simply read the variables at the very head of the script. But now I wonder how PHP could always use my URI parameters when I did not read them with $_GET... However, another nice lesson learned. ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic