Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 13,626 through 13,650 (of 32,503 total)
  • Author
    Search Results
  • #137921
    niuserre
    Participant

    content.php seems like a weird place to be swapping an image, is this a header image or something?

    From the way you’ve worded it I think maybe you need an if else statement around the specific image?

    if( is_bbpress() ) {
    
    // bbpress image
    
    } else {
    
    // default image
    
    }

    Is that the issue? If not, could you describe a bit more what you’re expecting to happen and what is happening instead please? It could also be that you actually need a BuddyPress if call rather than bb.

    #137916
    TobiasHartmann
    Participant

    Hello,

    I am using WordPress with bbPress(2.4) an buddyPress(1.8.1).

    Trying to change the image when I am in the forum.

    Trying it with : <?php if ( is_bbPress() ) : ?> in my content.php under my theme…

    No effect !

    Are there other ways to change the appearance?

    Greetings,
    Tobias

    #137909

    In reply to: Landing page issues

    benjito
    Participant

    Thanks for this. I have had a go this morning and tried adding a bbpress.php duplicate of several different files (index, post, page..) none of which seemed to make a difference.

    Apparently the Customizr theme structure is a little complex and the theme is split in parts, i can’t say i understand all that much but that seems to be the problem!

    At least for now i have gone with a function which removes the “forums” breadcrumb and prevents linking to that page which i have replaced with the static page containing shortcodes.

    #137896
    niuserre
    Participant

    Your child theme needs to call your normal WordPress theme as its parent. It will then use your normal theme and add your child theme customisations on top.

    If you have followed the instructions there, especially Step 5 (including the bit where it tells you to follow the ones here: https://codex.wordpress.org/Child_Themes) then activating the theme should still use your normal theme as well.

    #137895
    Feracon
    Participant

    I have followed this guide http://codex.bbpress.org/step-by-step-guide-to-creating-a-custom-bbpress-theme/

    to create a child theme containing the default bbpress theme files. It appears in my wordpress admin CP themes but I don’t see how this lets me apply it to only the bbpress.

    If I were to make it active it would retheme my entire wordpress site.

    #137891

    In reply to: Landing page issues

    niuserre
    Participant

    The breadcrumb uses the default Forum Index even if you use a shortcode to display your forum so it will always link back to the automatically created Forum Index.

    If you only need the shortcode method because of the template problem then let’s fix the template so you don’t need the shortcode.

    From: https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    On a plain vanilla install of bbPress using a “normal” wordpress theme, the plugin looks for the following templates from the active wordpress theme and “injects” the forum into (i guess) the first one it finds:

    ‘plugin-bbpress.php’,
    ‘bbpress.php’,
    ‘forums.php’,
    ‘forum.php’,
    ‘generic.php’,
    ‘page.php’

    I’m guessing your theme doesn’t have one of those so bbPress appears to be using some kind of archive template.

    You need to give bbPress a theme template to hook into. In your theme folder (or in a child theme if you want to do auto-updates with your theme) create a bbpress.php template, you can probably just create a duplicate of one of your theme templates and change its name.

    Here’s my bbpress.php template: http://pastebin.com/ZquKQfmw (Adept is my theme name, hence @package Adept). I took my theme’s full width template and duplicated it, called it bbpress.php then changed the header information. bbPress will figure out the rest.

    #137887
    niuserre
    Participant

    It is best not to make changes to the bbPress core files because they will be lost when you update. The same for your theme files unless it’s already a custom theme. The best way is with a Child Theme.

    In your theme folder (or preferably, child theme), create a subfolder called css with a file called bbpress.css so you have /wp-content/themes/%your-theme%/css/bbpress.css

    The last rule defined overrides any previous, conflicting rules so this file will make your styles the last rules. See if it works then and if it still doesn’t then check for what is overwriting it – because something is.

    (Specificity is usually the reason why your CSS doesn’t work the way you think it should. If there are styles in your code that are more specific, they will win. There is a good article on specificity at Smashing Mag.)

    #137880
    EL45
    Participant

    Hello,

    Calling <?php echo do_shortcode('[bbp-topic-index]'); ?> shows the latest 15 posts and it does show the pagination ie: “1 2 … 7 →”. However when selecting the next page (or any page for that matter) I get redirected to ?post_type=forum&paged=2 but the same 15 posts remain.

    Has anyone seen this or know a fix?

    #137863
    mcartur
    Participant

    You are right niuserre, let me apologize,

    As far as I am aware, we are not using shortcodes (we have not created any page for showing the forums but using directly the templates and urls filled on the settings).

    I am working with a tweenty twelve child theme. My wordpreses version 3.6.1. My bbpress: Version 2.4 localized to spanish.

    The exact issue is that whenever I try to edit a written post, raw html appears in the text area for editing. The html that appears is not only the one corresponding to the content of the reply i would like to edit.

    It comprises also the breadcrums and much more tags and content of the page. Exactly inside the editor appears all the content inside the <div class=”entry-content”> tag (this element is the parent of<div id=”bbpress-forums”>).

    I do not what that can be related with…

    Thank you for your time,

    #137861
    niuserre
    Participant

    For those saying they have the same thing, please can you be more specific to help identify the problem?

    So versions and theme being used plus the steps you take to produce the error (imagine you’re talking someone on the phone through how to get the same problem you did so they can see it too, imagine they’re not good at this stuff so you have to be really obvious about everything).

    Also, are you using bbpress shortcodes in a page to display your forums or not?

    #137850

    In reply to: Profile user ID help

    SA8001
    Participant

    You absolute STAR!!!! Just using bbp_get_user_id( 0, true, false ) worked perfectly as in echo '<a href="'.$link.'?pmaction=newmessage&to='.bbp_get_user_id( 0, true, false ).'">

    Thanks x 1000

    #137844

    In reply to: i can't see username

    niuserre
    Participant

    It is caused by a CSS problem.

    .reply a {
    display: inline-block;
    position: absolute;
    right: 0;
    bottom: -2px;
    height: 20px;
    padding: 6px 10px 2px;
    font-family: 'BebasNeueRegular',sans-serif;
    font-size: 14px;
    font-size: .875rem;
    font-style: normal;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    }

    When I turn off position: absolute; the name appears.

    #137843

    In reply to: Profile user ID help

    niuserre
    Participant

    Another guess… bbp_get_user_id( 0, true, false )

    Which translates as:

    bbp_get_user_id ([int $user_id = 0], [bool $displayed_user_fallback = true], [bool $current_user_fallback = false])

    #137835

    In reply to: Profile user ID help

    niuserre
    Participant

    This is a complete guess based on the way it’s done for a reply which is this:

    <a href="'.$link.'?pmaction=newmessage&to='.get_the_author_meta("ID").'"><span class="pm">Send for author a PM</span></a>

    So I’m thinking get_user_meta("ID") maybe?

    #137833
    RobotBash
    Participant

    Hi,
    Anyone know how to call the profile from the bbpress user profile to a custom page template? Tried a few pieces of code and searched this site but having no luck! Would appreciate any advice…

    #137823

    Topic: Profile user ID help

    in forum Plugins
    SA8001
    Participant

    Hi,

    I’m trying to integrate the Cartpauj PM plugin with my new install of bbPress.

    I want to add a private message link to member’s profile page, so when they click the link it pre-poluates the ‘To’ field in the message.

    I’m using…

    
    <?php if($page = get_page_by_title('title of the page for messages')) 
    {  
                            $link = get_permalink($page->ID); 
    
                            echo '<a href="'.$link.'?pmaction=newmessage&to='xx'">  
                            <span class="pm">Message 
                            </a></span></a>';  
    
                            } ?>

    But I’m stuck at what ‘xx’ should be.

    If I use .$user_ID.

    echo '<a href="'.$link.'?pmaction=newmessage&to='.$user_ID.'">

    It pre-popluates my user name correctly. Anyone help with what I need to use to pull in the ID of the profile the message link is attached to? I’ve tried '.bbp_displayed_user_field( 'ID' ).' – that pulls the correct ID number but places it outside of the clickable link

    Anyone steer me in the right direction?

    Thanks in advance

    Jayzzz
    Participant

    Yeah anyone with an update for the code? It’s not working on my theme either.

    #137814

    In reply to: Freshness Link

    niuserre
    Participant

    You have <?php bbp_forum_permalink(); ?> in your code, which I guess should be <?php bbp_last_topic_permalink(); ?> if you want to link to the topic.

    #137807
    niuserre
    Participant

    Yes, you are correct, unfortunately there’s no easy way to do get hidden at the moment. However, I’ve just tried manually reverting the changes from 2.4 that are causing the problem and it looks like that works.

    All I’ve done is revert the 3 changes here: https://bbpress.trac.wordpress.org/changeset/5060/trunk/includes/forums/functions.php

    I’ve done it fast and dirty by editing core and replacing the new lines with the old ones which you really shouldn’t do if you can avoid it as it will be overwritten next update….but hopefully next udpate will fix the problem anyway. I can’t see it causing problems anywhere else and that code was only changed for best practice I think so should be OK.

    #137788
    niuserre
    Participant

    I’ve done it using a filter in my functions.php but I’d be interested to know why the above method doesn’t work if anyone can explain please.

    My code in case anyone needs it:

    function add_clearfix( $classes ) {
    
    	$classes[] = 'clearfix';
    
    	return $classes;
    	}
    	
    	add_filter( 'bbp_get_forum_class', 'add_clearfix' );
    #137786
    niuserre
    Participant

    bbPress 2.4
    WP 3.6.1
    running on localhost

    I need to add a class to bb_forum_class and since 2.1 I thought that this should work:

    <?php bbp_forum_class('clearfix'); ?>

    But it’s not adding the class, can anyone tell me what I’m doing wrong please?

    I think the relevant bit of core for this is:

    function bbp_get_forum_class( $forum_id = 0, $classes = array() ) {
    		$bbp       = bbpress();
    		$forum_id  = bbp_get_forum_id( $forum_id );
    		$count     = isset( $bbp->forum_query->current_post ) ? $bbp->forum_query->current_post : 1;
    		$classes   = (array) $classes;
    
    		// Get some classes
    		$classes[] = 'loop-item-' . $count;
    		$classes[] = ( (int) $count % 2 )                      ? 'even'              : 'odd';
    		$classes[] = bbp_is_forum_category( $forum_id )        ? 'status-category'   : '';
    		$classes[] = bbp_get_forum_subforum_count( $forum_id ) ? 'bbp-has-subforums' : '';
    		$classes[] = bbp_get_forum_parent_id( $forum_id )      ? 'bbp-parent-forum-' . bbp_get_forum_parent_id( $forum_id ) : '';
    		$classes[] = 'bbp-forum-status-'     . bbp_get_forum_status( $forum_id );
    		$classes[] = 'bbp-forum-visibility-' . bbp_get_forum_visibility( $forum_id );
    
    		// Ditch the empties
    		$classes   = array_filter( $classes );
    		$classes   = get_post_class( $classes, $forum_id );
    
    		// Filter the results
    		$classes   = apply_filters( 'bbp_get_forum_class', $classes, $forum_id );
    		$retval    = 'class="' . implode( ' ', $classes ) . '"';
    
    		return $retval;
    	}
    #137783
    damien990
    Participant

    As you said, expert can make the “shortcode” to override the password….
    do you know the trick!

    #137780
    niuserre
    Participant

    There is not an easy way to do this, as far as I know.

    You could create a private WordPress page/post that is password protected and use a bbpress shortcode to display the forum on that page but anyone who has the direct link to that forum could skip the password.

    #137770

    In reply to: Freshness Link

    CC-Cailin
    Participant

    Hey, I modified it a little to fit the needs of my forum…
    I can’t show you the link as I’m working on localhost at the moment, but here is what I did.

    Inside loop-single-forum.php, I removed this:

    <?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    <?php bbp_forum_freshness_link(); ?>
    <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>

    And placed this in it’s place:

    <a class="bbp-forum-freshness" href="<?php bbp_forum_permalink(); ?>">
    <?php bbp_forum_last_topic_title(); ?></a> 
    (<?php bbp_forum_last_active_time(); ?>) by <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>

    Now the last step I need help with is…
    Right now if a forum doesn’t have posts in it yet, it shows the time I created the forum. Which is very weird. So what I i need is a php if/else code that would check if there is a forum_last_topic if there is, it must show my code… if there isn’t, it must show the text “No topics yet”. How do I do this? I have very basic php knowledge

    #137768

    In reply to: Freshness Link

    FreeWPress
    Participant

    In strange, because i use this with no problems, are you sure u have add the code after freshenss in forum loop?? I have opened a new thread here because this metod of Freshness in forum do not work fine, it id discordant from topic Freshness..

    Please write here a link of your forum…

Viewing 25 results - 13,626 through 13,650 (of 32,503 total)
Skip to toolbar