Forums

isset problem (4 posts)

  1. JediSthlm
    Member
    Posted 5 years ago #

    Hi
    This is my first post so bare with me if this has already been posted in this forum.
    At my blog I have started with a new design. I would like to have the frontpage as one design and all the other pages, as another. My idea was to make use of the isset php function. When you first enter the page the url would without any vars. When the user hits an article or search the vars are set in the url like this cat=20.
    The function I made was an if function, if an var is set it would write id=contentpage if not it would write id="frontpage".
    I just made an testpage wich do not have anyting to do with WP and then it work. The code is also on this page
    http://www.jedisthlm.com/var.php
    and
    http://www.jedisthlm.com/var.php?cat=20
    When I then add the code to my index.php file it does not work.
    http://www.jedisthlm.com/index-utv.php
    and
    http://www.jedisthlm.com/index-utv.php?cat=20
    Anyone knows what I am doing wrong?

  2. prara
    Member
    Posted 5 years ago #

    I think you have to use isset with the rest of the variables like:
    isset($p) || isset($cat) || isset($s) || isset($static)

  3. rubyji
    Member
    Posted 5 years ago #

    Try using <?php if(is_home()) ... as described here http://wordpress.org/support/3/13505

  4. JediSthlm
    Member
    Posted 5 years ago #

    Thanks alot all for your answers.
    I used the QUERY_STRING function and now it works like a charm.
    :D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.