Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,276 through 7,300 (of 32,505 total)
  • Author
    Search Results
  • #169314
    Robkk
    Moderator

    @danceee3

    Oh I forgot, put the customized loop-single-topic.php you have to a folder called bbpress in your child theme. bbPress should then use that file, and you should see the changes immediately.

    #169311
    Robkk
    Moderator

    You can just use the code I posted here. It is more customizable then the other one in the codex article and the other topic you linked to. I might change it in the codex article later on to this one too.

    Login, Register, Lost Password links

    You can put a custom page like this '/page-slug/'. Here I made it so where when a user logs out they go to a page called “Logout” that has the permalink slug “logout”.

    add_filter( 'wp_nav_menu_items', 'rkk_add_auth_links', 10 , 2 );
    function rkk_add_auth_links( $items, $args ) {
        if (is_user_logged_in() && $args->theme_location == 'sub-header-menu') {
            $items .= '<li><a href="'. wp_logout_url('/logout/') .'">Log Out</a></li>';
        }
        elseif (!is_user_logged_in() && $args->theme_location == 'sub-header-menu') {
            $items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
            $items .= '<li><a href="'. site_url('wp-login.php?action=register') .'">Register</a></li>';
            $items .= '<li><a href="'. site_url('wp-login.php?action=lostpassword') .'">Lost Password</a></li>';
        }
        return $items;
    }
    #169310
    Robkk
    Moderator

    Since I see you have Avada, you may need to go through some plugin troubleshooting.

    Troubleshooting

    Also your notification bar says for users to not register, you can disallow that by going into Settings > General and disable Anyone can register. Enable it again whenever you want.

    #169309
    Robkk
    Moderator

    Try this custom css, I think I got ahold of most of the styles you would need to fix this issue. Make sure to place these CSS styles into your child themes stylesheet or anywhere else you can place custom CSS styles into, like in a separate plugin

    #bbpress-forums ul>li {
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding-left: 0 !important;
    }
    
    #bbpress-forums ul>li:before {
        margin-left: 0 !important;
        content: ā€˜ā€˜ !important;
        margin-right: 0 !important;
        bottom: 0 !important;
        position: relative !important;
        display: block !important;
    }
    
    #bbpress-forums li {
        color: inherit !important;
        margin: 0 !important;
    }
    #169308
    lissyhunnybee
    Participant

    I’m not a theme author or a coder, I just muddle through with what I find on Google for a lot of php stuff lol but I am learning every time someone shows me a better way to achieve something šŸ™‚

    Thank you!

    #169307
    Robkk
    Moderator

    You could have done what most theme authors do with the post tag list when they are customizing it and replace <?php bbp_topic_tag_list(); ?> with something like this.

    <?php bbp_topic_tag_list( 0, array(
    	'sep'    => ''
    ) ); ?>
    #169301
    Robkk
    Moderator

    On my menu on wordpress I am getting link.com/forum-4/ and I cant remove the ā€œ-4ā€?

    Well you created a page called forum 3 other times that is why it adds the -4 to the end.

    If you are creating a “forum page”, know that you really do not have to do this. Just go to /forums or whatever the forum root slug is set in your forum settings in Settings > Forums.

    I’m getting the same error on bbpress with some forums.

    Are you naming a forum, “forum”??

    Also, where is the function for users to register and their profiles?

    Since your using the bbPress plugin, you register through WordPress login and register forms. bbPress has some shortcodes you can place in a page, and they will redirect you to the default WordPress forms since they aren’t really dedicated forms.

    Profiles should be present if users click their name on the bbPress login widget, the author link in their posts, or you can add a custom menu item using a function in this guide.

    Layout and functionality – Examples you can use

    #169290
    Pascal Casier
    Moderator

    Hi kallard,
    The best place to start from would probably be the bbpress codex: https://codex.bbpress.org/themes/
    If you are not really sold on this theme, try to look for bbpress compatible themes to get started faster.
    Pascal.

    DealL
    Participant

    How to remove Title prefixes ‘Topic:’ and ‘Forum:’?

    I can see these tickets :

    https://bbpress.trac.wordpress.org/ticket/1764
    &
    https://bbpress.trac.wordpress.org/changeset/5018

    are discussing the issue but I don’t know how to use them.

    Do I upload the files attached in the topics as plugins? Or do I paste the code from the files in functions.php of my child theme?

    Kindly help

    Thank you

    #169282
    mica123
    Participant

    Hello again,

    many apologies for causing a misunderstanding here. All the login/logout links work. I was only asking about the profile link after logout – this is also fine. My question can be ignored.

    Many apologies to @robkk. The profile link code is his – taken from How to add user profile link to specific menu

    Thanks.

    #169279

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    Hi… I am trying this. I want to auto-subscribe all users to new forums and I have tried the following:

    function ovni_subscribe_all_users_to_new_forum($forum_id){  // subscribe all users to a new forum
    	echo 'ovni_subscribe_all_users_to_new_forum fired';
    	// this function will fire on all wp-insert_posts - only act if is for a new forum
    	if ((get_post($forum_id)->post_type == bbp_get_forum_post_type()) && !wp_is_post_revision( $forum_id )){
    		// have just posted a new forum
    		$all_user_ids = get_users();
    		foreach ($all_user_ids as $user){
    			bbp_add_user_forum_subscription($user_id, $forum_id);
    			}
    		}
    	}
     add_action(save_post, ovni_subscribe_all_users_to_new_forum, 90,1);
    

    When I load the New Forum admin page, the echo trace statement appears at the top of the New Forum page, before it has been submitted.

    Can SKS help here please?

    #169270
    lissyhunnybee
    Participant

    It may not be the most elegant solution but the following worked for me….

    In your theme’s functions.php place this code:

    //* Remove Commas in BBPress Post Tag Display
    function my_bbp_topic_tag_list( $topic_id = 0, $args = '' ) {
    	echo my_bbp_get_topic_tag_list( $topic_id, $args );
    }
    
    function my_bbp_get_topic_tag_list( $topic_id = 0, $args = '' ) {
     
    		// Bail if topic-tags are off
    		if ( ! bbp_allow_topic_tags() )
    			return;
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'before' => '<div class="bbp-topic-tags"><p>' . esc_html__( 'Tagged:', 'bbpress' ) . '&nbsp;',
    			'sep'    => '',
    			'after'  => '</p></div>'
    		), 'get_topic_tag_list' );
     
    		$topic_id = bbp_get_topic_id( $topic_id );
    
    		// Topic is spammed, so display pre-spam terms
    		if ( bbp_is_topic_spam( $topic_id ) ) {
     
    			// Get pre-spam terms
    			$terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true );
     
    			// If terms exist, explode them and compile the return value
    			if ( !empty( $terms ) ) {
    				$terms  = implode( $r['sep'], $terms );
    				$retval = $r['before'] . $terms . $r['after'];
     
    			// No terms so return empty string
    			} else {
    				$retval = '';
    			}
     
    		// Topic is not spam so display a clickable term list
    		} else {
    			$retval = get_the_term_list( $topic_id, bbp_get_topic_tag_tax_id(), $r['before'], $r['sep'], $r['after'] );
    		}
     
    		return $retval;
    	}

    Then copy bbpress\templates\default\bbpress\content-single-topic.php into your theme bbpress folder and replace <?php bbp_topic_tag_list(); ?> with <?php my_bbp_topic_tag_list(); ?>

    Hope that helps others looking to do the same thing, and if there’s a better solution let me know lol

    #169263
    mica123
    Participant

    Hello,

    I hope you won’t mind if I come back to this topic. Everything works with the login and logout links – both redirecting to a certain page. I added the profile link to the menu which shows up after a user login (taken from Layout and functionality – Examples you can use as follows:

    function rk_bbp_menu_profile_link( $items, $args ) {
    
        if( is_user_logged_in() && $args->theme_location == 'sub-header-menu')  {
    
    		
    
    	$current_user = wp_get_current_user();
    
            $user = $current_user->user_nicename;
    
    	$profilelink = '<a href="/ihabbpress/tenant-forums/users/' . $user . '/">Your Profile</a>';
    
            $items .=  '<li>' . $profilelink .  '</li>';
    
    	}
    
        return $items;
    
    }

    This is fine except that when the user logs out, he/she stays on the same profile page
    he/she had been on before logging out. This is not good – users should be redirected to a specific page. I thought that this code would automatically inherit the redirection link from the Logout code. Many thanks.

    #169261
    danceee3
    Participant

    i cut the ifs but nothing happens, should have said this before, i am in no mean a programmer i did this

    <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
    
    		<span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
    
    	<?php do_action( 'bbp_theme_after_topic_started_in' ); ?>

    is this correct?

    #169235
    amalto
    Participant

    i can create forums as a drop-down menu? I would like to create forums as if they were a drop-down menu, but I can not with css code…

    #169231
    Robkk
    Moderator

    Thanks for the snippet, but will that add pagination or just put more forums on the page?

    There is no pagination for the forum archive page. There is this, but it outputs pagination for a single forum page.

    <?php bbp_forum_pagination_links(); ?>

    I might have to create a ticket to possibly add this in the future.

    I’d love to come up with some kind of awesome method to self organize all of these books, but that is unlikely to happen given the many restraints.

    I was thinking a better tagging system might help, but yeah.

    #169224
    Robkk
    Moderator

    Add this php function to your child themes functions.php file or in a plugin like functionality to increase the total ammount of forums in the page. It may also be better to just show the Topics by Freshness in the forum root instead by setting it in Settings > Forums.

    function rkk_increase_forum_per_page( $args ) {
        $args['posts_per_page'] = get_option( '_bbp_forums_per_page', 150 );
      return $args;
    }
    
    add_filter( 'bbp_before_has_forums_parse_args', 'rkk_increase_forum_per_page' );
    #169223
    Robkk
    Moderator

    At least i could prevent further entries in the two respective foren by using a math captcha and let only registered users to open new themes or respond to older ones

    From what I am reading on your post, you had anonymous posting activated and without spam protection even, which is the reason why there are a lot of spam posts on your forums. Having anyone to post on forums even without an account to your site will allow spammers to just wreck havoc. And from visiting your site I can tell most of the posts are from users without an account posting on your forums.

    I have de- an reactivated bbpress, un- and reinstalled it, but the messages are still there.

    Doing that doesn’t delete your posts.

    Since I see that there are a few posts from 2013 here and there, then most of the spam posts seem to come around October, you may need to suggest a nuclear option and possibly just delete all your bbPress forum post data in whole and start over. I am only suggesting this as i can see about 3 legitimate topics in a forum, then everything else was spam. To delete all of bbPress posts and data you have to follow this guide here and run the Reset Forums Tool. While trying to run this, tell me if it stalls up and gives you an error.

    Deleting bbPress

    If you have a backup of your database dating back before all the spam wrecked havoc, you can also restore that and be fine, but you will possibly lose some new data like new blog posts that you might of have created.

    If you do not make regular backups, make sure after the forum data is cleaned up, that you start doing so.

    Remember that when you are starting a forum, you will need to have some kind of spam protection in your forums from the start, especially if you are allowing people to post without an account. Also make sure to have some moderators on your site to catch any activity as it happens.

    Dealing with Spam

    #169219
    Robkk
    Moderator

    You may need to refresh any cache if you cannot see any changes appear.

    The original code in loop-single-topic.php from \wp-content\plugins\bbpress\templates\default\bbpress\loop-single-topic.php

    Has this code. Which makes it not show up in single forum pages, so it is only visible in topics created section in your forum profile, forum search, and the topic archive on yoursite.com/topics. You may need to remove the conditional if you want to always have it visible.

    <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() !== bbp_get_forum_id() ) ) : ?>
    
    	<?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
    
    		<span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
    
    	<?php do_action( 'bbp_theme_after_topic_started_in' ); ?>
    
    <?php endif; ?>
    #169210
    danperis
    Participant

    Hi,
    yes, I strongly believe that the mentioned behavior (which I confirm: 3 replies were added early today and they are not counted) was caused by some updates. However, how can I find which update caused it? Everytime an update is available I install it. Is wordpress keeping a log with activities as updates?
    One small detail: the freshness is updated when you re-load the page, in the sense that the code is considering the current time. But the freshness is not taking into account the last replies (like if no new reply was added).
    It seems that the reply is not triggering the functions that are updating counters: anyone has an idea on how this is implemented? So we could search for the cause…
    One detail more: I’m also using the “Orbisius bbPress Notify Me On Follow Up Replies” plugin and it also stopped sending emails when a new reply is added.
    Thanks!

    #169206
    seyibest
    Participant

    Thank you Pascal.
    I installed the plugin but the arrangment i made to subforum, all scattered.
    i have uninstalled it already hoping to get a better option later.

    But man, check my site http://www.guruscrib.net you will notice the login,register,forget password on the menu bar.
    so, how do i make it to be in a place like just only Login/Register on just a menu bar like “http://rush-hour-crush.co.uk&#8221;?

    and moreso, i made the homepage to be the forum. how can i code it in such a way that 2-3 of my post will appear on the homepage follow by the forum beneath it?

    Thanks so much man.
    you the boom.lol

    #169204
    Pascal Casier
    Moderator

    Hi,
    AFAIK, any import is ADDING records, so it will never erase what you already have.

    If you want to try yourself, there is always the custom import possibility: https://codex.bbpress.org/getting-started/importing-data/import-forums/custom-import/

    Pascal.

    #169189
    Robkk
    Moderator

    The file you are looking for that has this code should be part of the templates you can customize if you copy the file loop-single-topic.php from the bbPress plugin to your child theme.

    #169188
    Robkk
    Moderator

    Common thing to see if you activated tinymce for bbPress. Some of the html tags bbPress restricts usage from regular participants could also be used for Tinymce. Customize this function to your liking if there are many more html tags not outputting.

    add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
    function ntwb_bbpress_custom_kses_allowed_tags() {
    	return array(
    		// Links
    		'a'          => array(
    			'class'    => true,
    			'href'     => true,
    			'title'    => true,
    			'rel'      => true,
    			'class'    => true,
    			'target'    => true,
    		),
    		// Quotes
    		'blockquote' => array(
    			'cite'     => true,
    		),
    		
    		// Div
    		'div' => array(
    			'class'     => true,
    		),
    		
    		// Span
    		'span'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    		
                    // Paragraph
    		'p'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    
    		// Code
    		'code'       => array(),
    		'pre'        => array(
    			'class'  => true,
    		),
    		// Formatting
    		'em'         => array(),
    		'strong'     => array(),
    		'del'        => array(
    			'datetime' => true,
    		),
    		// Lists
    		'ul'         => array(),
    		'ol'         => array(
    			'start'    => true,
    		),
    		'li'         => array(),
    		// Images
    		'img'        => array(
    			'class'    => true,
    			'src'      => true,
    			'border'   => true,
    			'alt'      => true,
    			'height'   => true,
    			'width'    => true,
    		),
    		// Tables
    		'table'      => array(
    			'align'    => true,
    			'bgcolor'  => true,
    			'border'   => true,
    		),
    		'tbody'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'td'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tfoot'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'th'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'thead'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tr'         => array(
    			'align'    => true,
    			'valign'   => true,
    		)
    	);
    }

    You may not need to completely turn off the html editor tab now, as it is quite useful for users.

    David
    Participant

    Hello

    The freshness time (2 hours ago) IS accurate but when I go into a post and see the post and replys, all times listed are off by 8 hours not reflecting my timezone. I’m in Pacific time / San Francisco. Is there a fix for this?

    I’m still getting the site built but see:
    https://www.myacim.com/community/topic/why-would-i-say-nothing-means-anything/

    I am:
    WordPress 4.3.1
    bbpress 2.5.8
    I have switched to theme 2013 and the problem still exists.

    Also, I’m not a programmer so if the fix requires code I’ll need you to tell me where to stick it. (I can access files through cpanel file manager)

    Thank you so much in advance for your help community!

Viewing 25 results - 7,276 through 7,300 (of 32,505 total)
Skip to toolbar