Classifeds to show also on Main site

Hi, is there a way to show the classifieds posted on a sub domain by a member to also appear on the Main site?

  • airdee
    • New Recruit

    Thanks PC for your prompt response. There is an error when I put it on the sidebar.

    Fatal error: Call to undefined function network_query_posts() in /home/website/public_html/wp-content/plugins/recent-global-posts-widget/widget-recent-global-posts.php on line 80

  • airdee
    • New Recruit

    I’m using the theme edu-clean. The code on line 80

    $network_query = network_query_posts( array( 'post_type' => $recentglobalpoststype, 'posts_per_page' => $recentglobalpostsnumber ));

    function widget( $args, $instance ) {

    global $wpdb, $current_site;
    global $network_query, $network_post;

    extract($args);

    $defaults = array( 'recentglobalpoststitle' => '',
    'recentglobalpostsdisplay' => '',
    'recentglobalpostsnumber' => '',
    'recentglobalpoststitlecharacters' => '',
    'recentglobalpostscontentcharacters' => '',
    'recentglobalpostsavatars' => '',
    'recentglobalpostsavatarsize' => '',
    'recentglobalpoststype' => 'post',
    'count' => 10,
    'username' => 'wordpress'
    );

    foreach($defaults as $key => $value) {
    if(isset($instance[$key])) {
    $defaults[$key] = $instance[$key];
    }
    }

    extract($defaults);

    $title = apply_filters('widget_title', $recentglobalpoststitle );

    ?>
    <?php echo $before_widget; ?>
    <?php echo $before_title . __($title) . $after_title; ?>
    <br />
    <?php
    $network_query = network_query_posts( array( 'post_type' => $recentglobalpoststype, 'posts_per_page' => $recentglobalpostsnumber ));

    if( network_have_posts() ) {
    echo '<ul>';
    while( network_have_posts()) {
    network_the_post();
    echo '<li>';

    $the_permalink = network_get_permalink();
    $the_title = network_get_the_title();
    $the_content = network_get_the_content();

    if ( $recentglobalpostsavatars == 'show' ) {
    echo '<a href="' . $the_permalink . '">' . get_avatar( network_get_the_author_id(), $recentglobalpostsavatarsize, '' ) . '</a>';
    echo ' ';
    }
    if ( $recentglobalpostsdisplay == 'title_content' ) {
    echo '<a href="' . $the_permalink . '">' . substr( $the_title, 0, $recentglobalpoststitlecharacters ) . '</a>';
    echo '<br />';
    echo substr( strip_tags( $the_content ), 0, $recentglobalpostscontentcharacters );
    } else if ( $recentglobalpostsdisplay == 'title' ) {
    echo '<a href="' . $the_permalink . '">' . substr( $the_title, 0, $recentglobalpoststitlecharacters ) . '</a>';
    } else if ( $recentglobalpostsdisplay == 'content' ) {
    echo substr( strip_tags( $the_content ), 0, $recentglobalpostscontentcharacters );
    echo ' (<a href="' . $the_permalink . '">' . __('More') . '</a>)';
    }
    echo '</li>';
    }
    echo '</ul>';
    }

    ?>
    <?php echo $after_widget;

    }

    anyone?