Advertisement
richardpd

WPThemeIndex integration with BuddyPress index.php?

Aug 14th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.46 KB | None | 0 0
  1. My index.php from anIMass theme:
  2. <?php get_header(); ?>
  3.  
  4.  
  5. <div id="maincontent">
  6.  
  7. <article>
  8.  
  9. <div id="content" role="main">
  10.  
  11. <?php
  12.  
  13. /**
  14.  
  15. * The loop that displays posts.
  16.  
  17. *
  18.  
  19. * The loop displays the posts and the post content. See
  20.  
  21. * http://codex.wordpress.org/The_Loop to understand it and
  22.  
  23. * http://codex.wordpress.org/Template_Tags to understand
  24.  
  25. * the tags used in it.
  26.  
  27. *
  28.  
  29. * This can be overridden in child themes with loop.php or
  30.  
  31. * loop-template.php, where 'template' is the loop context
  32.  
  33. * requested by a template. For example, loop-index.php would
  34.  
  35. * be used if it exists and we ask for the loop with:
  36.  
  37. * <code>get_template_part( 'loop', 'index' );</code>
  38.  
  39. *
  40.  
  41. * @package WordPress
  42.  
  43. * @subpackage anIMass
  44.  
  45. * @since anIMass 7.0
  46.  
  47. */
  48.  
  49. ?>
  50.  
  51.  
  52.  
  53. <?php /* Display navigation to next/previous pages when applicable */ ?>
  54.  
  55. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  56.  
  57. <div id="nav-above" class="navigation">
  58.  
  59. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'anIMass' ) ); ?></div>
  60.  
  61. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'anIMass' ) ); ?></div>
  62.  
  63. </div><!-- #nav-above -->
  64.  
  65. <?php endif; ?>
  66.  
  67.  
  68.  
  69. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  70.  
  71. <?php if ( ! have_posts() ) : ?>
  72.  
  73. <div id="post-0" class="post error404 not-found">
  74.  
  75. <h1 class="entry-title"><?php _e( 'Not Found', 'anIMass' ); ?></h1>
  76.  
  77. <div class="entry-content">
  78.  
  79. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'anIMass' ); ?></p>
  80.  
  81. <?php get_search_form(); ?>
  82.  
  83. </div><!-- .entry-content -->
  84.  
  85. </div><!-- #post-0 -->
  86.  
  87. <?php endif; ?>
  88.  
  89.  
  90.  
  91. <?php
  92.  
  93. /* Start the Loop.
  94.  
  95. *
  96.  
  97. * In Twenty Ten we use the same loop in multiple contexts.
  98.  
  99. * It is broken into three main parts: when we're displaying
  100.  
  101. * posts that are in the gallery category, when we're displaying
  102.  
  103. * posts in the asides category, and finally all other posts.
  104.  
  105. *
  106.  
  107. * Additionally, we sometimes check for whether we are on an
  108.  
  109. * archive page, a search page, etc., allowing for small differences
  110.  
  111. * in the loop on each template without actually duplicating
  112.  
  113. * the rest of the loop that is shared.
  114.  
  115. *
  116.  
  117. * Without further ado, the loop:
  118.  
  119. */ ?>
  120.  
  121. <?php while ( have_posts() ) : the_post(); ?>
  122.  
  123.  
  124.  
  125. <?php /* How to display posts in the Gallery category. */ ?>
  126.  
  127.  
  128.  
  129. <?php if ( in_category( _x('gallery', 'gallery category slug', 'anIMass') ) ) : ?>
  130.  
  131. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  132.  
  133. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'anIMass' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  134.  
  135.  
  136.  
  137. <div class="entry-meta">
  138.  
  139. <?php anIMass_posted_on(); ?>
  140.  
  141. </div><!-- .entry-meta -->
  142.  
  143.  
  144.  
  145. <div class="entry-content">
  146.  
  147. <?php if ( post_password_required() ) : ?>
  148.  
  149. <?php the_content(); ?>
  150.  
  151. <?php else : ?>
  152.  
  153. <?php
  154.  
  155. $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
  156.  
  157. if ( $images ) :
  158.  
  159. $total_images = count( $images );
  160.  
  161. $image = array_shift( $images );
  162.  
  163. $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
  164.  
  165. ?>
  166.  
  167. <div class="gallery-thumb">
  168.  
  169. <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
  170.  
  171. </div><!-- .gallery-thumb -->
  172.  
  173. <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'anIMass' ),
  174.  
  175. 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'anIMass' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
  176.  
  177. $total_images
  178.  
  179. ); ?></em></p>
  180.  
  181. <?php endif; ?>
  182.  
  183. <?php the_excerpt(); ?>
  184.  
  185. <?php endif; ?>
  186.  
  187. </div><!-- .entry-content -->
  188.  
  189.  
  190.  
  191. <div class="entry-utility">
  192.  
  193. <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'anIMass'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'anIMass' ); ?>"><?php _e( 'More Galleries', 'anIMass' ); ?></a>
  194.  
  195. <span class="meta-sep">|</span>
  196.  
  197. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'anIMass' ), __( '1 Comment', 'anIMass' ), __( '% Comments', 'anIMass' ) ); ?></span>
  198.  
  199. <?php edit_post_link( __( 'Edit', 'anIMass' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  200.  
  201. </div><!-- .entry-utility -->
  202.  
  203. </div><!-- #post-## -->
  204.  
  205.  
  206.  
  207. <?php /* How to display posts in the asides category */ ?>
  208.  
  209.  
  210.  
  211. <?php elseif ( in_category( _x('asides', 'asides category slug', 'anIMass') ) ) : ?>
  212.  
  213. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  214.  
  215.  
  216.  
  217. <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
  218.  
  219. <div class="entry-summary">
  220.  
  221. <?php the_excerpt(); ?>
  222.  
  223. </div><!-- .entry-summary -->
  224.  
  225. <?php else : ?>
  226.  
  227. <div class="entry-content">
  228.  
  229. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'anIMass' ) ); ?>
  230.  
  231. </div><!-- .entry-content -->
  232.  
  233. <?php endif; ?>
  234.  
  235.  
  236.  
  237. <div class="entry-utility">
  238.  
  239. <?php anIMass_posted_on(); ?>
  240.  
  241. <span class="meta-sep">|</span>
  242.  
  243. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'anIMass' ), __( '1 Comment', 'anIMass' ), __( '% Comments', 'anIMass' ) ); ?></span>
  244.  
  245. <?php edit_post_link( __( 'Edit', 'anIMass' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  246.  
  247. </div><!-- .entry-utility -->
  248.  
  249. </div><!-- #post-## -->
  250.  
  251.  
  252.  
  253. <?php /* How to display all other posts. */ ?>
  254.  
  255.  
  256.  
  257. <?php else : ?>
  258.  
  259. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  260.  
  261. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'anIMass' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  262.  
  263.  
  264.  
  265. <div class="entry-meta">
  266.  
  267. <?php anIMass_posted_on(); ?>
  268.  
  269. </div><!-- .entry-meta -->
  270.  
  271.  
  272.  
  273. <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
  274.  
  275. <div class="entry-summary">
  276.  
  277. <?php the_excerpt(); ?>
  278.  
  279. </div><!-- .entry-summary -->
  280.  
  281. <?php else : ?>
  282.  
  283. <div class="entry-content">
  284.  
  285. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'anIMass' ) ); ?>
  286.  
  287. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'anIMass' ), 'after' => '</div>' ) ); ?>
  288.  
  289. </div><!-- .entry-content -->
  290.  
  291. <?php endif; ?>
  292.  
  293.  
  294.  
  295. <div class="entry-utility">
  296.  
  297. <?php if ( count( get_the_category() ) ) : ?>
  298.  
  299. <span class="cat-links">
  300.  
  301. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'anIMass' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  302.  
  303. </span>
  304.  
  305. <span class="meta-sep">|</span>
  306.  
  307. <?php endif; ?>
  308.  
  309. <?php
  310.  
  311. $tags_list = get_the_tag_list( '', ', ' );
  312.  
  313. if ( $tags_list ):
  314.  
  315. ?>
  316.  
  317. <span class="tag-links">
  318.  
  319. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'anIMass' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  320.  
  321. </span>
  322.  
  323. <span class="meta-sep">|</span>
  324.  
  325. <?php endif; ?>
  326.  
  327. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'anIMass' ), __( '1 Comment', 'anIMass' ), __( '% Comments', 'anIMass' ) ); ?></span>
  328.  
  329. <?php edit_post_link( __( 'Edit', 'anIMass' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  330.  
  331. <span class="meta-sep">|</span>
  332.  
  333. <a href="<?php echo get_permalink(); ?>">Permalink</a>
  334.  
  335. </div><!-- .entry-utility -->
  336.  
  337.  
  338.  
  339. <div class="post2">
  340.  
  341. </div>
  342.  
  343. </div><!-- #post-## -->
  344.  
  345.  
  346.  
  347. <?php comments_template( '', true ); ?>
  348.  
  349.  
  350.  
  351.  
  352.  
  353. <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
  354.  
  355.  
  356.  
  357. <?php endwhile; // End the loop. Whew. ?>
  358.  
  359.  
  360.  
  361. <?php /* Display navigation to next/previous pages when applicable */ ?>
  362.  
  363. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  364.  
  365. <div id="nav-below" class="navigation">
  366.  
  367. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'anIMass' ) ); ?></div>
  368.  
  369. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'anIMass' ) ); ?></div>
  370.  
  371. </div><!-- #nav-below -->
  372.  
  373.  
  374.  
  375.  
  376.  
  377. <?php endif; ?>
  378.  
  379.  
  380.  
  381. </div><!-- #content -->
  382.  
  383.  
  384.  
  385. </article>
  386.  
  387.  
  388.  
  389. <!--index.php end-->
  390.  
  391. <!--include sidebar-->
  392.  
  393. <?php get_sidebar(); ?>
  394.  
  395. <!--include footer-->
  396.  
  397. <?php get_footer(); ?>
  398.  
  399.  
  400.  
  401. Index.php from bbpress/activity
  402.  
  403. <?php get_header() ?>
  404.  
  405. <div id="content">
  406.  
  407. <div class="padder">
  408.  
  409. <?php if ( !is_user_logged_in() ) : ?>
  410. <h3><?php _e( 'Site Activity', 'buddypress' ) ?></h3>
  411. <?php endif; ?>
  412.  
  413. <?php do_action( 'bp_before_directory_activity_content' ) ?>
  414.  
  415. <?php if ( is_user_logged_in() ) : ?>
  416. <?php locate_template( array( 'activity/post-form.php'), true ) ?>
  417. <?php endif; ?>
  418.  
  419. <?php do_action( 'template_notices' ) ?>
  420.  
  421. <div class="item-list-tabs activity-type-tabs">
  422. <ul>
  423. <?php do_action( 'bp_before_activity_type_tab_all' ) ?>
  424.  
  425. <li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ) ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?></a></li>
  426.  
  427. <?php if ( is_user_logged_in() ) : ?>
  428.  
  429. <?php do_action( 'bp_before_activity_type_tab_friends' ) ?>
  430.  
  431. <?php if ( function_exists( 'bp_get_total_friend_count' ) ) : ?>
  432. <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
  433. <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_FRIENDS_SLUG . '/' ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ) ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
  434. <?php endif; ?>
  435. <?php endif; ?>
  436.  
  437. <?php do_action( 'bp_before_activity_type_tab_groups' ) ?>
  438.  
  439. <?php if ( function_exists( 'bp_get_total_group_count_for_user' ) ) : ?>
  440. <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
  441. <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_GROUPS_SLUG . '/' ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ) ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
  442. <?php endif; ?>
  443. <?php endif; ?>
  444.  
  445. <?php do_action( 'bp_before_activity_type_tab_favorites' ) ?>
  446.  
  447. <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
  448. <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/favorites/' ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ) ?>"><?php printf( __( 'My Favorites (<span>%s</span>)', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
  449. <?php endif; ?>
  450.  
  451. <?php do_action( 'bp_before_activity_type_tab_mentions' ) ?>
  452.  
  453. <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/mentions/' ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ) ?>"><?php printf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ) ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '(%s new)', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) ?></strong><?php endif; ?></a></li>
  454.  
  455. <?php endif; ?>
  456.  
  457. <?php do_action( 'bp_activity_type_tabs' ) ?>
  458. </ul>
  459. </div><!-- .item-list-tabs -->
  460.  
  461. <div class="item-list-tabs no-ajax" id="subnav">
  462. <ul>
  463. <li class="feed"><a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ) ?></a></li>
  464.  
  465. <?php do_action( 'bp_activity_syndication_options' ) ?>
  466.  
  467. <li id="activity-filter-select" class="last">
  468. <select>
  469. <option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option>
  470. <option value="activity_update"><?php _e( 'Show Updates', 'buddypress' ) ?></option>
  471.  
  472. <?php if ( bp_is_active( 'blogs' ) ) : ?>
  473. <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option>
  474. <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option>
  475. <?php endif; ?>
  476.  
  477. <?php if ( bp_is_active( 'forums' ) ) : ?>
  478. <option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ) ?></option>
  479. <option value="new_forum_post"><?php _e( 'Show Forum Replies', 'buddypress' ) ?></option>
  480. <?php endif; ?>
  481.  
  482. <?php if ( bp_is_active( 'groups' ) ) : ?>
  483. <option value="created_group"><?php _e( 'Show New Groups', 'buddypress' ) ?></option>
  484. <option value="joined_group"><?php _e( 'Show New Group Memberships', 'buddypress' ) ?></option>
  485. <?php endif; ?>
  486.  
  487. <?php if ( bp_is_active( 'friends' ) ) : ?>
  488. <option value="friendship_accepted,friendship_created"><?php _e( 'Show Friendship Connections', 'buddypress' ) ?></option>
  489. <?php endif; ?>
  490.  
  491. <option value="new_member"><?php _e( 'Show New Members', 'buddypress' ) ?></option>
  492.  
  493. <?php do_action( 'bp_activity_filter_options' ) ?>
  494. </select>
  495. </li>
  496. </ul>
  497. </div><!-- .item-list-tabs -->
  498.  
  499. <div class="activity">
  500. <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
  501. </div><!-- .activity -->
  502.  
  503. <?php do_action( 'bp_after_directory_activity_content' ) ?>
  504.  
  505. </div><!-- .padder -->
  506.  
  507.  
  508. </div><!-- #content -->
  509.  
  510. <?php locate_template( array( 'sidebar.php' ), true ) ?>
  511.  
  512. <?php get_footer() ?>
  513.  
  514.  
  515. How do I integrate these?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement