Ticket #5906: codex-update-sidebar-menus-add-page-section-template.patch
File codex-update-sidebar-menus-add-page-section-template.patch, 7.0 KB (added by , 10 years ago) |
---|
-
codex-buddypress-org/page-section.php
1 <?php 2 /* 3 Template Name: Page Section 4 */ 5 ?> 6 7 <?php get_header(); ?> 8 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> 9 10 <h2 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2> 11 12 <?php if ( get_the_content() ) : 13 14 the_content( __( '<p class="serif">Read the rest of this page →</p>', 'buddypress' ) ); 15 16 wp_link_pages( array( 'before' => __( '<p><strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p>', 'next_or_number' => 'number') ); 17 18 else : ?> 19 20 <p>This page has no content of its own, but contains some sub-pages listed in the sidebar.</p> 21 <p>Please edit this page and add something helpful!</p> 22 23 <?php endif; ?> 24 25 <?php endwhile; endif;?> 26 27 <hr class="hidden" /> 28 29 <?php 30 global $post; 31 32 $args = array( 'order' => 'ASC', ); 33 $revisions = wp_get_post_revisions( get_queried_object_id(), $args ); 34 $post_authors = array( $post->post_author => 1 ); 35 foreach( (array)$revisions as $revision ) { 36 $post_authors[$revision->post_author] += 1; 37 } 38 asort( $post_authors, SORT_NUMERIC ); 39 40 global $codex_contributors; 41 $codex_contributors = array_reverse( $post_authors, true ); 42 ?> 43 44 <?php locate_template( array( 'sidebar-section.php' ), true ); ?> 45 46 <?php get_footer(); ?> 47 No newline at end of file -
codex-buddypress-org/page.php
1 1 <?php get_header(); ?> 2 2 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> 3 3 4 <h 1 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h1>4 <h2 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2> 5 5 6 6 <?php if ( get_the_content() ) : 7 7 -
codex-buddypress-org/screen.css
6 6 7 7 /* Typography 8 8 --------------------------------------------------------------------*/ 9 /* Enlarge and stagger heading sizes - temp! */ 10 body h1 {font-size: 28px;} 11 body h2 {font-size: 24px;} 12 body h3 {font-size: 20px;} 13 body h4 {font-size: 18px;} 14 body h5 {font-size: 16px;} 15 body h6 {font-size: 14px;} 9 16 10 17 .content h1 { 11 18 font-size: 24px; 12 19 margin-bottom: .5em; 13 20 } 21 html body .content{ font-size: 16px; font-size: 1rem;} 22 /* Navigation elements 23 ----------------------------------------------------------------- */ 14 24 25 /*__ Subnav __*/ 26 27 /* Codex breadcrumbs */ 28 29 div#subnav { 30 clear: both; 31 margin-top: 134px; 32 } 33 #subnav #subnav-inner { padding-left: 0;} 34 35 /* Sidebar menu navigation */ 36 37 .sidebar .listified ul li a {font-size: 14px; font-weight: bold;} 38 .sidebar .listified ul ul.children li {margin-left: 10px;} 39 .sidebar .listified ul ul.children li a {font-weight: normal;} 40 41 42 15 43 /* Sections 16 44 * ----------------------------------------------------------------- */ 17 45 .table-of-contents-widget { -
codex-buddypress-org/sidebar-section.php
1 </div> 2 <div class="sidebar"> 3 4 <?php if ( is_page() || is_front_page() ): 5 6 $show_related = false; 7 if ( !empty( $post->post_parent ) ) { 8 9 $children = wp_list_pages('title_li=&echo=0&child_of=' . $post->ID); 10 if ( $children ) { 11 $rel = '<ul>' . $children . '</ul>'; 12 echo '<div class="related-content-widget widget listified"><h3 class="widgettitle">In This Section</h3>' . $rel . '</div>'; 13 $show_related = true; 14 } 15 } 16 17 if ( !is_page( 'home' ) && $show_related ) { 18 $rel = ''; 19 $cat = get_the_category(); 20 $relateds = get_posts('nopaging=1&post_type=page&post_parent=0&orderby=title&order=ASC&cat=' . $cat[0]->term_id . '&exclude=' . $post->ID . ','); 21 if ( $relateds ) { 22 foreach ($relateds as $related) { 23 $title = apply_filters('the_title', $related->post_title); 24 $rel .= '<li><a href="' . get_permalink($related->ID) . '" title="' . $title . '">' . $title . '</a></li>'; 25 } 26 $rel = '<ul>' . $rel . '</ul>'; 27 echo '<div class="related-content-widget widget listified"><h3 class="widgettitle">Related</h3>' . $rel . '</div>'; 28 } 29 } 30 ?> 31 32 <?php endif; ?> 33 34 35 <div class="search-widget"> 36 <form method="get" id="searchform" action="<?php bloginfo( 'url' ); ?>/"> 37 <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" placeholder="Search" /> 38 <!-- <input type="submit" id="searchsubmit" value="Search" /> --> 39 </form> 40 </div> 41 42 <div class="user-widget"> 43 <ul> 44 <?php if ( is_user_logged_in() ) : ?> 45 <li><a href="<?php bloginfo( 'url' ); ?>/wp-admin/post-new.php?post_type=page">Create New Page</a></li> 46 <li><?php edit_post_link( __( 'Edit This Page', 'bborg' ) ); ?></li> 47 <?php endif; ?> 48 <?php if ( ! is_user_logged_in() ) : ?> 49 <li><a href="//wordpress.org/support/register.php">Register</a></li> 50 <li><a href="//wordpress.org/support/bb-login.php">Lost Password</a></li> 51 <li><a href="<?php bloginfo( 'url' ); ?>/login/">Log In</a></li> 52 <?php endif; ?> 53 </ul> 54 </div> 55 56 57 <?php if ( is_tax() ) { 58 global $codex_contributors; 59 60 if ( !empty( $codex_contributors ) ) { 61 echo '<div class="section-contributors widget">'; 62 echo '<h3 class="widgettitle">Top Authors</h3>'; 63 $codex_contributors = array_slice( $codex_contributors, 0, 5, true ); 64 foreach( (array)$codex_contributors as $contributor_id => $count ) { 65 $userdata = get_userdata( $contributor_id ); 66 echo '<div class="section-contributor">'; 67 echo '<div class="contributor-mug float-left">'; 68 echo get_avatar( $contributor_id, 48 ); 69 echo '</div>'; 70 echo '<div class="inner">'; 71 echo '<h5>' . esc_html( $userdata->display_name ) . '</h5>'; 72 echo '<p>' . esc_html( $count ) . ' document'; 73 if ( $count > 1 ) 74 echo 's'; 75 echo '</p>'; 76 echo '</div>'; 77 echo '<div class="clear-left"></div>'; 78 echo '</div>'; 79 } 80 echo '</div>'; 81 } 82 } ?> 83 84 </div> -
codex-buddypress-org/sidebar.php
26 26 $children = wp_list_pages('title_li=&echo=0&child_of=' . $post->ID); 27 27 if ( $children ) { 28 28 $rel = '<ul>' . $children . '</ul>'; 29 echo '<div class="related-content-widget widget listified"><h3 class="widgettitle"> Subpages</h3>' . $rel . '</div>';29 echo '<div class="related-content-widget widget listified"><h3 class="widgettitle">Pages & Sections</h3>' . $rel . '</div>'; 30 30 $show_related = false; 31 31 } 32 32 } ?>