• mmson

    (@mmson)


    Situation: Two tabs: our games and recommend games,

    There are also two cat for both tabs, however some posts would or extremly in a word 90% posts would exist in both cat but single page for two tabs is different, the tabs actived at least.

    So I want to use

    [please use backticks or the ‘code’ button to mark code]

    <?php
    
    	$post = $wp_query->post;
    	if (in_category('our-games')) {
    	   include(TEMPLATEPATH . '/single-our-games.php');
    	}else( in_category('recommend-games)) {
    	   include(TEMPLATEPATH . '/single-recommend-games.php');
    	}
    ;?>

    I need to click the games name in our game page list, the single page would display and the our game tab would still in actived,
    and if click the games title in recommend game page list, the single page would display and the recommend games tab would still in actived.

    But now if I click the former one or latter one, the single page tab would be our game tab, why?
    I now only solve the problem by copying one game twice and in separate into our game cat and recommend game cat.

    Is it any method for me to mixture the posts in both cat but my acitve tab work still?

    Hope you guys understand my description of the problem

The topic ‘in_category()….’ is closed to new replies.