Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Home
- */
- ?>
- <?php get_header() ?>
- <div class="row">
- <?php if ( is_user_logged_in() ) { ?>
- <div class="fourcol">
- <?php get_sidebar() ?>
- </div>
- <div class="eightcol">
- <div class="page">
- <?php
- global $current_user;
- get_currentuserinfo();
- if ($current_user->primary_blog) {
- $primary_dash_url = get_blogaddress_by_id($current_user->primary_blog) . 'wp-admin/';
- $primary_url = get_blogaddress_by_id($current_user->primary_blog);
- $primary_blog = get_blog_details($current_user1->primary_blog);
- }
- ?>
- <h3>Share</h3>
- <div class="welcomeText">
- <h4>Hello <?php echo $current_user->display_name; ?>.
- <?php switch_to_blog($current_user->primary_blog);
- $terms = get_terms("trip");
- $count = count($terms);
- $published_posts = wp_count_posts()->publish;
- if($published_posts > 0 && $count > 0){
- echo("Your site <a href=\"".get_bloginfo('url')."\">".get_bloginfo('name')."</a> has ".$published_posts." posts in ".$count);
- if ($count > 1){echo (" trips.");} else {echo (" trip.");}
- echo("<br/><a href=\"".$primary_dash_url."post-new.php\"> Add more posts</a> or <a href=\"".$primary_dash_url."edit-tags.php?taxonomy=trip\">create a new trip.</a>");
- } else {
- echo("You haven't published anything yet.</h4><a href=\"".$primary_dash_url."\" class=\"getStarted bigbutton\">Get Started</a>");
- }
- echo("</div>");
- restore_current_blog();
- ?>
- <div class="clear">
- <h3>Explore</h3>
- <h4>Random images from across the Network</h4><?php
- $myimages = network_query_posts(array('post_type'=>'attachment','posts_per_page'=>10, 'orderby'=>'rand'));
- if( network_have_posts() ) {
- network_the_post();
- foreach($myimages as $image){
- echo var_dump($image);
- }
- }
- ?>
- </div>
- </div>
- </div>
- </div>
- <?php } else {
- include(dirname(__FILE__).'/visitor.php'); ?>
- <?php } get_footer() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement