Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,601 through 1,625 (of 32,466 total)
  • Author
    Search Results
  • #221283
    Robin W
    Moderator

    so how is it visible, as a menu item?
    and what method in item 3 of this are you using

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

    #221273
    sk80au
    Participant

    Hi,

    I’d like to modify the reply topic from paragraph <p> to heading <h1> or <h2>. I tried to modify few php files but couldn’t get it working. Also checked few codex content but couldn’t find anything relevant. Wondering if somone done this before or knows how to do it. Thanks.

    #221258
    jason4locations
    Participant

    If all I want to do is have links to the topics started (and replies created) by the user who is logged in, and I want something simpler than ProfileGrid and UsersWP, what words should I be using to search http://www.wpbeginner.com? Is there a better way to find which one to use?

    Do I even need another plugin to do that? Did I fail to see what I need when I was looking through the bbPress and Style Pack widgets, the bbp Style Pack tabs, and the bbPress shortcodes?

    #221232

    In reply to: is_bbpress not working

    Robin W
    Moderator

    there is an action hook on the forums index so

    add_action ('bbp_template_before_forums_index' , 'test_bbpress');

    shoul dwork

    #221224
    bobdobbs
    Participant

    I’m trying to detect requests for the bbpress forum index page.

    Initially I tried ‘bbp_is_forum_archive()’.
    This doesn’t return true from the forum archive page.

    I decided to test if any bbpress conditional tags were working, so I tested ‘is_bbpress’, because the function calls many (maybe all?) of the other conditionals.

    However, ‘is_bbress’ doesn’t return true either.

    However, on any page in my site, whether bbpress is on that page or not, this condition returns true:
    ‘if ( ! is_bbpress() )…’

    What could be happening here?

    This is my function and the hook I’m using:

    add_action('init', 'test_bbpress');
    function  test_bbpress() {
    
        if (  is_bbpress()  ) {
    	wp_die("got to the forums page") ;
        }

    }

    #221214
    Robin W
    Moderator

    so can you post the exact code you tried, and say where you put it

    #221208
    Robin W
    Moderator

    ok, try this

    add_filter ('bbp_get_time_since' , 'rew_time_since_translate' ) ;
    		
    	
    	function rew_time_since_translate ($output) {
    		$output = preg_replace('/years/', 'new word', $output);
    		$output = preg_replace('/year/', 'new word', $output);
    		$output = preg_replace('/days/', 'new word', $output);
    		$output = preg_replace('/day/', 'new word', $output);
    		
    		return $output ;
    	}

    so change ‘new word’ in each case for what you want to show

    you can add as many lines as you need, but always do the plural first so ‘years’ followed by ‘year’

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    #221203
    Barry
    Participant

    Is there a way to remove the widget and just have a page for folks to go to instead?

    A potentially quick and easy solution would be to create a page and embed the widget within it. To help with that, you might use this plugin or some other similar one:

    Widget Shortcode

    (I haven’t used it, and can’t vouch for it…and probably there are also block plugins that do much the same.)

    #221202
    Ole
    Participant

    Hi,

    I want to change generally all x days (years, whatever) ago to german like “vor x Tagen”.

    I Have found the code base in inludes/commeons/formatting.php.
    But I’m not so goog in develeoping.
    Can somebaody help me please?

    Kind regards,
    Ole

    jason4locations
    Participant

    The reason I asked Robin W. that question is because if the bbPress Login Widget has more than the following three options

    1. Title: Here you can set the title of the widget as it will be displayed in the sidebar.
    2. Register URI: Link to your custom signup page eg. A WordPress page using the [bbp-register] shortcode.
    3. Lost Password URI: Link to your lost-password page eg. A WordPress page using the [bbp-lost-pass] shortcode.

    then I might be missing out on too much to use a different Login Widget instead, and therefore I should try harder to figure out how to use the bbPress Login Widget, even though I’ve been struggling to figure out how to use it for a very long time.

    Mike Witt
    Participant

    @robin-w,

    … and anyone who happens to look at this and is running MemberPress.

    Yes, there is more to do with MP. MP Members may or may not have actual “Subscriptions.” They can also just have memberships without what MP calls subscriptions. These membership can go “inactive.” But, unfortunately, that can happen *temporarily* if their credit card needs to be updated.

    None-the-less, your code examples are quite valuable!

    In the unlikely event that anyone else here is running MP and is interested in this, please chime in here (or otherwise contact me). I would love to compare notes on this and related things.

    -Mike

    sino27
    Participant

    Thanks for your input but don’t waste time. I contacted some developers and they were able to provide me the code. It worked and I moved on to another project, I don’t even remember it. Anyway it was possible.

    All the best to you and stay healthy.

    Cheers

    bjornwebdesign
    Participant

    Well, as you can see, the code posted here is almost 5 years old. So it’s understandable it doesn’t work anymore ;-). Also, I don’t think a 404 means it’s a “serious privacy issue”. Something isn’t working correctly, so my first step would be to check the logs and see what is causing the 404 and go from there.

    Very busy atm and currently don’t have a BP test setup running. If you still need a solution maybe I can find some time in the coming days.

    bobdobbs
    Participant

    After installing bbpress I have a set of forums.

    Every forum is presented using a php template in my child theme.
    The php template has the filename bbpress.php.

    I’d like to create a php template that applies *just* to the individual forum pages. Not the forum topics or singles. Or anything else.

    I’ve been looking at this:

    Template hierarchy in detail

    The heirarchy seems to suggest that you can use ‘single-[forum].php’, which suggests that ‘[forum]’ needs to be substituted with the name of the forum.

    … which is great. But I want one template to be applied to all forum singles and nothing else.

    Just to test, I copied my existing bbress.php to a file called ‘single-forum.php’.
    bbpress did pick this up and use it for my forum singles.
    But the page didn’t present the actual forum. Where the forum should have been, there was just empty space.

    So… how do I create a template that gets applied to all forums and nothing else?

    #221109
    bobdobbs
    Participant

    I’ve set up a set of discussion forums on a site. Now I want to the purpose of each forum to be clear.

    One forum is called ‘Introductions’.
    I’d like to have a message on the page saying something like “Hi. This is where we get to know each other”.

    I guess I could hack up something with ACF and put some logic in the page template that shows the forums. But I’m wondering if there’s a faster option.

    Is there an inbuilt way to make add non-hardcoded content to the forum pages?

    #221104

    In reply to: error 401

    Robin W
    Moderator

    without knowing how you are set up, I cannot answer, and as I say I cannot visit your site to see where the login is.

    but try dashboard>permalimks and just click save – this resets the permalinks and may help.

    Otherwise where are your users logging in ? a page, or widget and if so what shortcode for the page or what widget?

    #221093
    djintelbe
    Participant

    Hello,

    Some mathematical objects written in mathjax/latex use backslash (\). For example, one use \sqrt{} for the square root function, \mathbb{} for the set of numbers. In bbpress forums, these objects work perfectly but when the forums are displayed in buddypress activities streams, the backslash disappears and therefore the mathematical symbols are not rendered and make the texts difficult to read. If the texts are typed directly in buddypress side, things are also alright. So, the problem seems to be in the transition from forum to the buddypress activities.

    I tried some solutions but nothing work. For example, I tried this solution: remove_filter( ‘bp_get_the_topic_post_content’, ‘stripslashes_deep’ ); but it did not work.
    So I am asking for help; how can I do to solve the problem?

    Thank you in advance

    Wordpress 5.7.2
    bbpress 2.6.6

    Regards

    Nestor

    Robin W
    Moderator

    @mike80222 looking again, your code might need

    $subscription = $event->get_data();
    $user = $subscription->user();
    $user_id = something more to get the ID ;

    but I’d suggest you raise a ticket or look through the documentation.

    Robin W
    Moderator

    BOTH

    You will need to test the below, as I don’t use either plugin on any forum site.

    PM PRO

    for PMpro you have the following hooks :

    Action and Filter Hooks

    I am guessing that pmpro_membership_post_membership_expiry is the correct hook.

    so the code you need is :

    add_action( 'pmpro_membership_post_membership_expiry', 'rew_remove_subscriptions') ;
    
    function rew_remove_subscriptions ($user_id=0) {
    	$forums = bbp_get_user_subscribed_forum_ids ($user_id) ;
    	foreach ($forums as $forum=>$id) {
    		bbp_remove_user_subscription ($user_id, $id, 'post' ) ;
    	}
    	$topics = bbp_get_user_subscribed_topic_ids ($user_id) ;
    	foreach ($topics as $topic=>$id) {
    	bbp_remove_user_subscription ($user_id, $id , 'post' ) ;
    	}
    }

    MEMBERPRESS

    for Memberpress you have the following links

    https://docs.memberpress.com/article/325-action-hooks-in-memberpress

    I am guessing that ‘mepr-event-subscription-stopped`

    is the correct one, but you might need to query with memberpress

    so for memberpress you would have

    add_action( 'mepr-event-subscription-stopped', 'rew_remove_subscriptions') ;
    
    function rew_remove_subscriptions ($event) {
    	$subscription = $event->get_data();
    	$user_id = $subscription->user();
    	$forums = bbp_get_user_subscribed_forum_ids ($user_id) ;
    	foreach ($forums as $forum=>$id) {
    		bbp_remove_user_subscription ($user_id, $id, 'post' ) ;
    	}
    	$topics = bbp_get_user_subscribed_topic_ids ($user_id) ;
    	foreach ($topics as $topic=>$id) {
    	bbp_remove_user_subscription ($user_id, $id , 'post' ) ;
    	}
    }

    BOTH

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    Robin W
    Moderator

    I’m playing with some code, give me a while to work it out !!

    #221071
    bobdobbs
    Participant

    I’ve installed bbpress and created a set of forums.

    On the forums page of my website, a linked list of forums shows… which is great.

    However, I now want to alter the order in which the forums are listed.

    Usually for post types, the admin screen allows a re-ordering of posts via the ‘quick edit’ link.
    However, in the bbpress forums admin screens, forums don’t have the ‘quick edit’ listing.

    I’ve installed and configured a couple of plugins that allow admins to re-order post types. These don’t seem to touch bbpress forums.

    At a last resort I’m sure I could find a code snippet online. But I’d like to work within the CMS admin as much as I can.

    Is there a way to alter the order of the bbpress forums list display without falling back to code?

    vincenzon617
    Participant

    I am thinking about editing what the shortcode [bbp-single-view id=’popular’] displays. What I would like to change it to is to display the most popular topics per day. For example, a topic that has 10 replies one day and so classed as ‘popular’ has 1 the next day and so it is no longer on the list.

    I have made a function that returns the number of replies in the current day by using the topicID but I am unsure where to go from here, to link it to this feature.

    Any help is greatly appreciated!

    #221055
    jason4locations
    Participant

    When I use the bbPress forum search form, it adds it to the search form that was already there, so now there are two. I’d prefer to only have one, the bbPress one. I thought removing the one that was already there would be a WordPress problem (not a bbPress problem) because, to remove it, I could use the Disable Search plugin or the code at

    https://www.wpbeginner.com/awp-tutorials/how-to-disable-the-search-feature-in-wordpress/

    with Code Snippets. But, neither of those two methods worked. I couldn’t find the form that was already there at the widgets page. I also couldn’t remove it by customizing a header. I know that this might seem like more of a WordPress or theme problem, but because bbPress has the option of adding its forum search form, I thought a lot of people who use bbPress might wind up with too many forms (and bring it up at this forum). But, I couldn’t find anyone who has the same problem as me, at this forum. My site is at dancing4locations.org. There, you can see the bbPress form that I want to keep below the login form, and the form that I want to remove (which is to the left of the login form).

    Thank you.

    #221028
    vincenzon617
    Participant

    Thanks for your reply. This is what I thought originally but I checked it and I have already turned this off so I am unsure. I could remove the code <?php bbp_reply_admin_links(); ?> from my ‘loop-single-reply.php’ file but this means I cannot moderate the comments which isn’t ideal.

    #221006
    jason4locations
    Participant

    I got back in, but then I got messages that said “There has been a critical error on your website. Please check your site admin email inbox for instructions” whenever I clicked on Dashboard and a lot of the other things, even while using ?snippets-safe-mode=true (which I can tell you about if you’re interested). So, maybe I’m not in. I don’t know if the problem was only because of how I used the Code Snippets plugin, or if it was because of how I used it with bbPress.

Viewing 25 results - 1,601 through 1,625 (of 32,466 total)
Skip to toolbar