samlester
Forum Replies Created
-
Forum: Networking WordPress
In reply to: List of all blogs on the main siteThanks for your help! That’s awesome.
Forum: Networking WordPress
In reply to: List of all blogs on the main siteHow would I integrate
switch_to_blog();
into my current code to display the description?Forum: Networking WordPress
In reply to: List of all blogs on the main siteCan I call that using
get_blog_details();
?It’s not on the codex page (https://codex.www.ads-software.com/WPMU_Functions/get_blog_details)
Here’s my code so far:
<?php global $wpdb; $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' AND blog_id != '1' ORDER BY path"; $blogs = $wpdb->get_results($query); foreach($blogs as $blog){ $blog_details = get_blog_details($blog->blog_id); ?> <div class="item"> <a href="<?php echo $blog_details->siteurl ?>"> <img class="item-img" src="<?php bloginfo('template_url'); ?>/img/placeholder-item.png" alt="item"/></a> </a> <a href="<?php echo $blog_details->siteurl ?>"><h2><?php echo $blog_details->blogname ?></h2></a> <p><?php echo $blog_details->blogdescription ?></p> <p><a href="<?php echo $blog_details->siteurl ?>">Check out their site »</a></p> </div> <?php } ?>
Forum: Networking WordPress
In reply to: List of all blogs on the main siteNowhere at the moment. I’m not sure of the best way to do it.
Forum: Networking WordPress
In reply to: List of all blogs on the main siteI’m fairly competent with code so I’m going to use
get_blog_details();
Thought there must be a function for it but I just couldn’t find it!Is there any way to store/retrieve other information about the sites? It’d be great to be able to output a description for each site.
Thanks!
Forum: Fixing WordPress
In reply to: Redirecting pages to create a symbolic structureHey,
Thanks for your reply. That would work but I was really looking for something (to put in the functions.php file?) that would automatically make each top level parent redirect to its first child rather than having to link each page to its child manually.
Thanks,
SamForum: Fixing WordPress
In reply to: Featured post – Calling thumbnailsAny ideas?