Forums

If CustomField value = "red" -- then do this (HELP) (2 posts)

  1. danieln12
    Member
    Posted 3 months ago #

    Hi, I'm new to WordPress and im having hard time dealing with CustomFields and a custom theme. All i need to know is the code for how to execute this idea:

    If CustomField value = "RED" ... then do something - else
    If CustomField value = "BLue" ... then do something

    In other words i need a customfield called TitleColor and depending on its value i want the theme to apply a css rule, in this example to change the Heading color property.

    If TitleColor = "RED" -- then {
    <h1 style="color: red;"> }

    else {
    <h1 style="background-color: blue;"}

    Thanks in advance :)

  2. alchymyth
    The Sweeper
    Posted 3 months ago #

    http://codex.wordpress.org/Custom_Fields

    particular if you new, it is important to try and study the Codex; you should usually be able to find a reference to the relevant chapter by using the web search for: 'codex custom fields' or what ever your problem is, or with whatever functions you are working

Reply

You must log in to post.

About this Topic