• Hi there.

    I am currently running a multisite.
    I need to show categories from Site A onto Site B. I manage that with the following code:

    <?php switch_to_blog(10);
    wp_list_categories(array (
    'orderby' => 'name',
    'child_of' => '193',
    'style' => '',
    'separator' => '<br /><br />',
    ));
    restore_current_blog();?>

    Is there a way that when I click on a category that I can get it to open in a new window? I don’t want my visitors to leave Site A all together.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Hello,

    You could try something like this:

    <?php
    switch_to_blog(10);
    $cats = wp_list_categories(array (
        'orderby' => 'name',
        'child_of' => '193',
        'style' => '',
        'separator' => '<br /><br />',
        'echo' => 0
    ));
    echo str_replace('<a','<a target="_blank"', $cats);
    restore_current_blog();
    ?>

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘WP List Categories Function’ is closed to new replies.