Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,551 through 10,575 (of 32,511 total)
  • Author
    Search Results
  • #152577

    In reply to: Online Magazine Theme

    Robin W
    Moderator

    sorry…

    <? get_sidebar(); ?>
    

    should read

    <?php get_sidebar(); ?>

    #152576
    Robin W
    Moderator

    try using the method shown here

    Layout and functionality – Examples you can use

    #152568

    In reply to: UNDEFINED Header. . .

    Robin W
    Moderator

    how are you accessing this page – which of these is it?

    Step by step guide to setting up a bbPress forum – Part 1

    #152557
    Robin W
    Moderator

    I think this should do it. It’s from my library of code and haven’t used it in a while, so come back if it’s not what you want

    You’ll need to add it to your functions file

    Functions files and child themes – explained !

    //This function adds descriptions to the sub forums
    function custom_list_forums( $args = '' ) {
    
    	// Define used variables
    	$output = $sub_forums = $topic_count = $reply_count = $counts = '';
    	$i = 0;
    	$count = array();
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => ' (',
    		'count_after'       => ')',
    		'count_sep'         => ', ',
    		'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );
    
    	// Loop through forums and create a list
    	$sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    	if ( !empty( $sub_forums ) ) {
    
    		// Total count (for separator)
    		$total_subs = count( $sub_forums );
    		foreach ( $sub_forums as $sub_forum ) {
    			$i++; // Separator count
    
    			// Get forum details
    			$count     = array();
    			$show_sep  = $total_subs > $i ? $r['separator'] : '';
    			$permalink = bbp_get_forum_permalink( $sub_forum->ID );
    			$title     = bbp_get_forum_title( $sub_forum->ID );
    			$content = bbp_get_forum_content($sub_forum->ID) ;
    
    			// Show topic count
    			if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
    			}
    
    			// Show reply count
    			if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
    			}
    
    			// Counts to show
    			if ( !empty( $count ) ) {
    				$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    			}
    
    			// Build this sub forums link
    			$output .= $r['before'].$r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'].'<div class="bbp-forum-content">'.$content.'</div>'.$r['after'];
    		}
    
    		// Output the list
    		return $output ;
    	}
    }
    
    add_filter('bbp_list_forums', 'custom_list_forums' );
    #152534
    robsward
    Participant

    Hi,

    How can I move a topic from one forum to another programmatically? I’m hoping to send a post variable with the new forum ID, and then update the topic like so:

    // Update the Status Meta After Changes are Posted
    if ( isset( $_POST['bbps_forum_option'] ) ) {
    
    	$new_forum = $_POST['bbps_forum_option'];
    
    	bbp_update_topic( $this->topic_id, $new_forum );
    
    } // if()

    Thanks!

    #152533
    robsward
    Participant

    There are a couple of issues with that code up there. Correct function is this one:

    public function forum_list(){
    
    	$forums		= array();
    
    	if ( bbp_has_forums() ) {
    		while ( bbp_forums() ) {
    
    			bbp_the_forum();
    
    			$forum_id = bbp_get_forum_id();
    			$forum_name = bbp_get_forum_title();
    			$data = array( 'ID' => $forum_id, 'name' => $forum_name );
    
    			$forums[] = $data;
    
    		} // while()
    	} // if()
    
    	return $forums;
    
    } // get_forum_list()
    #152532
    robsward
    Participant

    Hi,

    I’m trying to retrieve a simple list of all forums on a site, for which I need to have a loop. I’m trying to create one from within a class in my plugin using this function:

    public function forum_list(){
    
    	$forums		= array();
    
    	if ( bbp_has_forums() {
    		while ( bbp_forums() ) {
    
    			bbp_the_forum();
    
    			$forum_id = bbp_get_forum_id();
    			$forum_name = bbp_get_forum_title();
    			$data = array( 'ID' => $forum_id, 'name' => $forum_name );
    
    			$forums[] = $data;
    
    		//} // while()
    	} // if()
    
    	return $forums;
    
    } // get_forum_list()

    Which is called inside the construcor like so:

    $this->forums = $this->forum_list();

    This is telling me there is no object (Call to a member function get() on a non-object). The function works perfectly well outside the class, but inside it fails. What am I missing?

    #152526

    Topic: CSS questions

    in forum Themes
    EzYRiDaH
    Participant

    Hi there,
    I use the Genesis framework. In the Genesis theme there is a CSS part that sets the global margins.

    .entry {
    	margin-bottom: 40px;
    	padding: 50px 60px;
    }

    I managed to change a lot of the CSS by learning trial and error. I managed to change lot of the CSS of bbPress, but I don’t now how to change specific global things only affecting the bbPress forum.

    How can I change only the margings and the font type of the forum, without affecting the rest of the site (Genesis CSS).

    Your help is highly appreciated 🙂

    #152512
    Robin W
    Moderator

    The normal behaviour is to allow anyone to see profiles.

    You can limit this to only logged in users by adding some code to a couple of files.

    If you have c-panel or ftp access and know how to transfer files, come back and I’ll help you with the changes.

    #152510

    In reply to: Online Magazine Theme

    Robin W
    Moderator

    ok, save this file as bbpress.php into the root of your theme

    ie

    wp-content/themes/%yourthemename%/bbpress.php

    where %yourthemename% is the name of your theme !! 🙂

    Then add a line above the last, so that it now reads

    <? get_sidebar(); ?>
    <?php get_footer(); ?>

    bbpress will now use that page as the one for bbpress, and should display a sidebar.

    ‘tweaks’ should tghen sue this fro your forum sidebar.

    Come back if any of that doesn’t work, or you need more explanation

    #152506

    In reply to: Online Magazine Theme

    Topknotch
    Participant

    Thanks Robin

    <?php
    
    /**
    
     * Template Name: Full Width, no sidebar(s)
    
    */
    
    get_header(); ?>
    
        <div id="main-fullwidth">
    
            
    
            <?php 
    
                if (have_posts()) : while (have_posts()) : the_post();
    
                    /**
    
                     * Find the post formatting for the pages in the post-page.php file
    
                     */
    
                    get_template_part('post', 'page');
    
                    
    
                    if(comments_open( get_the_ID() ))  {
    
                        comments_template('', true); 
    
                    }
    
                endwhile;
    
                
    
                else :
    
                    get_template_part('post', 'noresults');
    
                endif; 
    
            ?>
    
            
    
        </div><!-- #main-fullwidth -->
    
        
    
    <?php get_footer(); ?>
    #152504

    In reply to: Online Magazine Theme

    Robin W
    Moderator

    can you post the code for the full width one here please

    #152495
    sdunning
    Participant

    I wish to show the description of each forum in the forum list as seen here:
    http://forum.unified-automation.com/

    If someone could point me towards the file and/or function I need to add/amend, I’d be eternally grateful.

    I have it laid out with the child forums listed as shown by following this example but when I last tried to show the description along side it, I got the WSOD (my php sucks).

    Thanks to any and all!

    WP version 4.0
    bbPress version 2.5.4

    #152485
    STG
    Participant

    Ok, I found it.

    I had a plug-in called Landing Page.

    It wasn`t enough to deactivate it. I deleted it and everything seems to work fine.
    Don`t ask how or why, it just worked.

    Thanks for your help.

    Loni
    Participant

    @nightcoder You Rock! I was having this same problem where the “s” was missing from our noreply address. I followed your instruction and modified bbpress/includes/common/functions.php and it works perfectly! Thank you very much. 🙂

    #152480
    Zane
    Participant

    Hey Stephen,

    Up until earlier today when I adjusted forum settings I believe it would just say “PRIVATE: Forumname”. Now I see “PRIVATE: PRIVATE Forumname”. Not sure what I changed to make that start happen.

    Is there a reason why you would want to say “PRIVATE: PRIVATE: Forumname”?

    I added the code you provided to the bottom of functions.php and no wordpress page would load.

    https://gist.github.com/ntwb/8662354

    I also tried saving ntwb_remove_protected_private_titles.php to my plugins directory with no luck. I guess I need a little more direction.

    Thanks!

    #152478
    coskel22
    Participant

    I am trying to help users and want to use the code backticks to display the BBCodes they need to use.

    It won’t display the actual code, it renders the code out instead when placed in backticks using the code/code buttons.

    Using a default theme, WP 4.0 and 2.5.4 bbpress

    #152475
    Stephen Edgar
    Keymaster

    I just moved your topic as it really has nothing to do with the other topic.

    You shouldn’t need a plugin to do that, simply browse to http://example.com/topics and you’ll have a list of the most recent topics or topics with replies sorted by freshness.

    As for colours, that will depend upon the theme, if the theme includes customised templates for bbPress then typically yes, if it does not you’ll end up with the some default colors bbPress sets for you in this case.

    There are lots of docs here to browse also https://codex.bbpress.org/

    #152467
    Robin W
    Moderator

    images are doable, but you’d need code that is beyond the free help on here

    #152466

    In reply to: Online Magazine Theme

    Robin W
    Moderator

    yes, you will need to rename one of your theme pages (the one that has only one sidebar) to bbpress.php and put it into your theme

    Step by step guide to setting up a bbPress forum – Part 1

    #152459

    In reply to: disable Sidebar

    Robin W
    Moderator

    yes, you will need to rename one of your theme pages (the one that has only one sidebar) to bbpress.php and put it into your theme

    Step by step guide to setting up a bbPress forum – Part 1

    #152448
    Robin W
    Moderator

    Yes, each of your

    ['my_custom_role']

    needs to be different, otherwise it’s just overwriting each time, which is why only the last one shows
    eg my_custom_role1 my_custom_role2

    giving

    $bbp_roles['my_custom_role1>'] = array( 
        'name' => 'Recruit',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      $bbp_roles['my_custom_role2'] = array( 
        'name' => 'Corporal',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
    
    
    #152445

    In reply to: Add forum roles

    arno8
    Participant

    I used this code, and added a few new ones but when i try assignem them it only shows 1

    #152444
    arno8
    Participant

    Hi everyone, i was wondering what i’m doing wrong here..
    I added 13 new roles in my themes functions.php, but when i try to assign them to my users it obly shows a few of them..

    img

    functions.php code

    function add_custom_role( $bbp_roles ) {
      $bbp_roles['my_custom_role'] = array( 
        'name' => 'Recruit',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      $bbp_roles['my_custom_role'] = array( 
        'name' => 'Corporal',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Sergeant',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Lieutenant',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Captain',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'General',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Admin',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Organiser',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Coordinator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Overseer',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Deputy Owner',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
       $bbp_roles['my_custom_role'] = array( 
        'name' => 'Owner',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Clan Wars Leader',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
      return $bbp_roles;
    }   
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

    Anyone has an idea?

    also how can i add images in front of the names? small icons like this: img

    #152434

    In reply to: Topic Icon plugin

    Robkk
    Moderator

    for just topic thumbnails you can use this https://wordpress.org/plugins/bbpress-topic-thumbnails/

    the functionality of that site might be something similar to this plugin https://wordpress.org/plugins/bbpress-unread-posts/

    for any other plugins you want just do a quick search

    Plugins

    https://wordpress.org/plugins/

    http://codecanyon.net/category/wordpress

Viewing 25 results - 10,551 through 10,575 (of 32,511 total)
Skip to toolbar