WordPress.org

Ready to get started?Download WordPress

Forums

[closed] query string into a conditional tags.. how to? (4 posts)

  1. andreacutelli
    Member
    Posted 4 years ago #

    Hi there,

    I must put a custom query string as
    <?php echo get_post_meta($post->ID, "whatiwant", true); ?>

    into a conditional tags as:
    <?php if (is_category('xxxxxxxx')) { echo 'hello'; } ?>

    instead of "xxxxxxx"

    how I can write the php code for this..?

  2. MichaelH
    Member
    Posted 4 years ago #

    Huh???? ;)

    <?php
    $cf=get_post_meta($post->ID, "whatiwant", true);
    if (is_category($cf)) {
      echo 'hello';
    }
    ?>
  3. andreacutelli
    Member
    Posted 4 years ago #

    uhm..
    I have written half problem :-))

    I must do this:

    <?php if( is_category('4') ) echo '';?>

    but '4' (the category) must be this:
    category-<?php echo get_post_meta($post->ID, "whatiwant", true); ?>

    and the echo must be this:

    <li><a href=" <?php echo get_option("home"); ?>/<?php echo get_post_meta($post->ID, "whatiwant", true); ?>/">example</a></li>

    how can I write this in php..??
    sorry again..!

  4. MichaelH
    Member
    Posted 4 years ago #

    Continue discussion here:
    http://wordpress.org/support/topic/378058

Topic Closed

This topic has been closed to new replies.

About this Topic