Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 7,343 total)

  • Robin W
    Moderator

    @robin-w

    sorry, I only do live code, so don’t know what rc7 does


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed


    Robin W
    Moderator

    @robin-w

    untested, and probably from a purist view not the most elegant solution, but this should work

    add_filter( 'bbp_current_user_can_access_create_topic_form' , 'rew_only_mods' , 10 , 1) ;
    
    function rew_only_mods ($retval) {
    	// Users need to earn access
    	$retval = false;
    	//check if admin
    	if ( bbp_is_user_keymaster() ) {
    		$retval = true;
    	}
    		//check if moderator
    	$role = bbp_get_user_role( get_current_user_id());
    	if ($role == 'bbp_moderator') {
    		$retval = true;
    	}
    // Allow access to be filtered
    	return (bool) apply_filters( 'rew_current_user_can_access_create_topic_form', (bool) $retval );
    }
    

    Also allows keymasters, but I presume you want that.

    Put this in your child theme’s function file – or use

    Code Snippets

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    great – glad you are fixed, I learnt some stuff as well about how wordpress does pagination, so win-win !!


    Robin W
    Moderator

    @robin-w

    no problem !!


    Robin W
    Moderator

    @robin-w

    link to an example on your site please


    Robin W
    Moderator

    @robin-w

    suspect that modern events calander has had an update.

    I agree that ‘adding extra server code without need’ is a good policy, but unless you get modern events calendar to understand the issue and then fix, then the answer is that you need the fix πŸ™‚

    I suspect they will simply say it is a bbpress issue, which in a way it is


    Robin W
    Moderator

    @robin-w

    but if you really want to debug

    It could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back


    Robin W
    Moderator

    @robin-w

    I’m author of that fix.

    It may well be something that coincided with you installing that plugin – maybe a theme or another plugin update, updating wordpress, or even your host updating versions of php.

    The error you quote is a function in your THEME affecting a bbpress function. Your theme author has decided to re-write some bbpress functions by the look of it. So looks like that error (which may or may not be the issue – I suspect not) is one to take up with your theme author

    You could spend days working out what the issue is, if the fix works, then I’d tend to just use it.

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    ok, the code I gave you was topics in a forum, not replies in a topic.

    try this instead

    add_filter( 'bbp_replies_pagination', 'rew_change_shown' ) ;
    
    function rew_change_shown ($args) {
    	$args['mid_size'] = 8 ;
    return $args ;
    }

    Robin W
    Moderator

    @robin-w

    It could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    hmmm….not sure I can help without visiting the site – is it private ?


    Robin W
    Moderator

    @robin-w

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>forum templates

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    Right now, It display 1,2,3…722,723,724

    so is this EXACTLY what it displayed without the code ?

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    you want ‘snippets’ that is the php code bit

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    Additional CSS panel

    ah, this is not css, this is php code, it needs to go in the functions file of your child theme or the code snippets plugin. If it is the latter, that should also give you what then error is – I need to know what that say if it doesn’t work

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    when you say it gives errors – can you say exactly what these are?

    In reply to: Edit Pagination Range

    Robin W
    Moderator

    @robin-w

    I can’t remember it ever being asked πŸ™‚

    However after a bit of digging, this will change it

    add_filter( 'bbp_topic_pagination', 'rew_change_shown' ) ;
    
    function rew_change_shown ($args) {
    	$args['mid_size'] = 8 ;
    return $args ;
    }

    8 shows ‘8 +previous and next’ – so 10 – amend the number to whatever you want

    Put this in your child theme’s function file – or use

    Code Snippets


    Robin W
    Moderator

    @robin-w

    This is because in the bbpress plugin there is a template called content-search.php. Many themes also now have a template file called content-search.php. Since the bbPress templates don’t necessarily need to be in a bbPress folder, the bbPress plugin is choosing the template from your theme before the template that is actually in bbPress.

    To fix copy content-search.php from the bbPress plugin templates and place it in a child theme in a folder called bbpress.

    Functions files and child themes – explained !

    So create a directory on your child theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-search.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-search.php
    bbPress will now use this template instead of the original


    Robin W
    Moderator

    @robin-w

    written by me for free, and having no idea quite how your site is set up, or what settings within each plugin you are using, I cannot possibly say whether it will conflict. There are thousands of themes and tens of thousands of plugins – you will need to test. That’s kinda the deal with OSF software – sorry πŸ™‚


    Robin W
    Moderator

    @robin-w

    your choice


    Robin W
    Moderator

    @robin-w

    thanks for posting your solution


    Robin W
    Moderator

    @robin-w

    hmmm…not sure what is happening – suspect it is theme related. But it would require extensive investigation to work out what is happening


    Robin W
    Moderator

    @robin-w

    wordpress themes can do funny things with bbpress.

    It’s all to do with load order.

    If it is working in the custom css, I’d leave it there


    Robin W
    Moderator

    @robin-w

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>login

Viewing 25 replies - 1 through 25 (of 7,343 total)