Forums

When clicking a page -> redirecting to a sub page? (1 post)

  1. hilj
    Member
    Posted 1 year ago #

    I have listed some categories and pages in my sidebar like this this:

    MENU ITEM
       sub item
       sub item
       sub item

    When I click the "MENU ITEM" it goes to the "MENU ITEM" page, of course. But I would like it to go to the first "sub item" page.

    It can be done with conditional tags, something like this:

    <?php if (is_category('1'))
    	{
    	??????????????
    	}
    	else { ?>
            // Page here
            <?php } // end of the "else" ?>

    What I don't know is how am I redirecting it? What should I put where the question marks are? And if I'm dealing with pages the is_page () can used.

    Thank you.

    edit: typo

Topic Closed

This topic has been closed to new replies.

About this Topic