• I’m making a new theme and before displaying the links I would like to check if there are links.

    If there are links, they are displayed, if there are no links, they are not displayed …

    What would be valid PHP code for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter selder2

    (@selder2)

    I tried something like this, but it gives me a parse error …

    <?php if (get_links_list != "") echo "<div class=\"arch-right\">" get_links_list() "</div>" ?>

    Thread Starter selder2

    (@selder2)

    this is working almost, but the condition isn’t working …

    <?php if (get_links_list != NULL) echo get_links_list() ?>

    Does anyone has an idea what I can put as condition?

    Thread Starter selder2

    (@selder2)

    Nailed it. Here’s the code:

    $displink = get_links ('-1', '', '', '', FALSE, 'id', FALSE, FALSE, '-1', FALSE, FALSE);

    if ($displink != "")
    {
    echo "<div class=\"arch-right\"><h2>links</h2> <ul>";
    get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', TRUE, TRUE, -1, TRUE);
    echo " </ul> </div>";
    };
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to check if there are “links”?’ is closed to new replies.