Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 826 through 850 (of 32,454 total)
  • Author
    Search Results
  • #234099
    anthvale
    Participant

    Looking for a line of code or a post meta field name to retrieve a link for the current user’s topics page. Is this something you can help me with?

    #234081
    Robin W
    Moderator

    so if you remove the code that you had and just use the plugin, does this fix?

    #234055

    In reply to: Help with installation

    Robin W
    Moderator
    #234053
    enkoes
    Participant

    Hi Robin, after spent some time trying to understand the codes, I tried and finally got the results that I wanted.

    For loop-topics.php,
    I change:

    <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic()
    				? esc_html_e( 'Replies', 'bbpress' )
    				: esc_html_e( 'Posts',   'bbpress' );
    			?></li>

    to:
    <li class="bbp-topic-reply-count"><?php esc_html_e( 'Replies', 'bbpress' ); ?></li>

    and for loop-single-topic.php,
    I change:
    <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?></li>
    to:
    <li class="bbp-topic-reply-count"><?php bbp_topic_reply_count(); ?></li>

    Since I don’t have any knowledge about PHP codes, I’m not sure what I did is correct or not, anyway at least work on my browser.

    Regards

    #234030
    Robin W
    Moderator

    bbp style pack

    lets you style your forums

    you can also use the translations tab of this to change Posts to Replies

    there is also

    bbPress Styling Crib

    which contains styling guides

    #234031
    Robin W
    Moderator

    bbp style pack

    lets you style your forums

    you can also use the translations tab of this to change Posts to Replies

    there is also

    bbPress Styling Crib

    which contains styling guides

    #234004
    Ludovic S. Clain
    Participant

    Hey ๐Ÿ‘‹ย 
    Thank you @Robin-W,
    In the meantime I got to know the WP-Cli-Cli package specific to WordPress, which does not work either (I opened an issue visible here).

    To locate the context, I use WooCommerce Subscription plugin and I needed that when a subscription is canceled, access to the bbPress forum is blocked.

    I leave here the snippet that I made and that does the job:

    add_action('woocommerce_subscription_status_cancelled', 'block_forum_user_after_subscription_cancellation_s', 10, 1);
    function block_forum_user_after_subscription_cancellation_s($subscription)
    {
        $user_id = $subscription->get_user_id();
        $new_role = 'bbp_blocked';
        bbp_set_user_role($user_id, $new_role);
    }

    (I also have a webhook version with the WordPress Rest API for remote use, if necessary contact me)

    #234000
    Robin W
    Moderator

    bbp_set_user_role( $user_id, $new_role )

    #233997
    Ludovic S. Clain
    Participant

    Hi there ๐Ÿ‘‹ย 

    Thanks to the details of @stanis I am understanding why when I use WP-Cli with the line:
    wp user set-role <User id> bbp_blocked

    It blows up the existing role of the User on WordPress (in my case it was “customer” which becomes ” – no role for this site -“)

    But it’s still unclear for me. How to modify the role of an User on BBPPRESS without touching its WordPress role?

    Because the opposite is also true, if I do :
    wp user set-role <User ID> customer

    This time it is the role of the User on the forum that jumps and becomes “-No Role for these forums-”

    PS: I also tried
    wp user update <User ID> --role=customer --bbp-forums-role=bbp_blocked
    And that doesn’t do the job too ๐Ÿ™

    Thanks for your lights!
    Warm regards,
    Ludovic

    #233962

    In reply to: User email management

    timholland
    Participant

    Hi Robin,

    I looked at the forum screens and there is a button for adding a forum to a digest. I clicked it and it changed to give me the option to remove it from the digest.

    A second link is there for editing digest settings, however when I click it, I get:

    Page Not Found
    The page you were looking for could not be found. It might have been removed, renamed, or did not exist in the first place.

    The link is https://somd-scalemodelers.club/members/timh/edit/#bbp-digest-check-row

    And if I understand correctly, thatโ€™s a function in the bbpress digest plugin php code.

    Any ideas where I should look next?

    Regards,
    Tim

    #233937

    In reply to: Archives:Forums

    Robin W
    Moderator

    Try this

    add_filter( 'get_the_archive_title', 'to_archive_title_remove_prefix' );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( '', false );
    }
    return $title;
    }

    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

    #233915
    Robin W
    Moderator

    1. only replies
    2. bespoke code needed

    #233842
    Robin W
    Moderator

    2nd – works in my browser for your site – can you close and reopen and check again, or post a new image showing what is still wrong, and links to an exact example.

    3rd – I don’t know what ‘no output results’ means ??? again it seems to have gone from your site in my browser.

    I did see that I had not taken out the ‘author/posts’ from the footer – you can add this

    .forums.bbp-replies li.bbp-footer {
            display: none;
    }
    #233839

    In reply to: Custom Profile Fields

    scottmotion
    Participant

    First you could try Robin’s bbPress plugin: https://wordpress.org/plugins/bbp-profile-information/
    Same with BuddyPress integration: https://wordpress.org/plugins/bbp-buddypress-profile-information/

    If you’re not using BuddyPress though I would highly recommend looking into it. You can enable “Extended Profile Fields” and there’s also a plugin for custom field types: https://wordpress.org/plugins/bp-xprofile-custom-field-types/

    As far as the outbound links themselves go you might need to code/style them yourself unless your theme automatically converts links.

    #233838
    Robin W
    Moderator

    my code above corrected works, but yes do come back and let us know if you find the problem or need further help

    #233837
    saciojote
    Participant

    Yes I did I noticed that before I tried the code. I will play around and see if I can find the problem, if the get_page_by_title() works as I would like then it must be an error somewhere else.

    Thank you for your help!

    #233835
    Robin W
    Moderator

    put this in the custom css of you theme

    div.bbp-template-notice.info {
    	display: none;
    }
    
    .bbp-pagination-count {
    	display: none;
    }
    
    .forums.bbp-replies li.bbp-header {
            display: none;
    }
    #233827
    Robin W
    Moderator

    ok, based on that I have no idea what you mean by embedding.

    bbpress does not have a ‘login page’ it has shortcodes and widgets.

    the template used by bbpress for login is

    bbpress\templates\default\bbpress\form-user-login.php

    to customise :

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-user-login.php

    transfer this to your pc and edit as desired

    and save

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

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

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-user-login.php

    bbPress will now use this template instead of the original

    #233826
    pcwd
    Participant

    Theme my login does not allow embedding.
    As I wrote at the beginning of the post, I would like to customize the bbpress login page.
    Can you help me run that PHP code with Code Snippets?
    Thank you very much!

    #233823
    pcwd
    Participant
    <?php
    if ( ! is_user_logged_in() ) { // Display WordPress login form:
        $args = array(
            'redirect' => admin_url(), 
            'form_id' => 'loginform-custom',
            'label_username' => __( 'Username custom text' ),
            'label_password' => __( 'Password custom text' ),
            'label_remember' => __( 'Remember Me custom text' ),
            'label_log_in' => __( 'Log In custom text' ),
            'remember' => true
        );
        wp_login_form( $args );
    } else { // If logged in:
        wp_loginout( home_url() ); // Display "Log Out" link.
        echo " | ";
        wp_register('', ''); // Display "Site Admin" link.
    }
    ?>

    I entered that code with the Code Snippets Plugin but it didnโ€™t work ๐Ÿ™

    #233821
    Robin W
    Moderator

    that is a page full of code – so what did you put in?

    #233820
    pcwd
    Participant

    Hi Robin,
    thanks for your reply.

    I entered that code with the Code Snippets Plugin but it didn’t work. Why?

    #233819
    Robin W
    Moderator

    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

    #233815
    Robin W
    Moderator

    did you correct the error in this line

    if (!empty ($topic) {

    should be

    if (!empty ($topic)) {

    #233805
    saciojote
    Participant

    Hi Robin, thank you for the example code! I have tried it and it seems to return the same value regardless of the title, so I am unsure…

    Here is the sample code that I have used the function within:

    function return_content_replies() {
    	
    	$title = $_POST['title'];
    	$topic_id = rew_find_topic_id($title);
    	
    	if ( $topic_id == 'empty' ) { 
    	  	// create the topic here
    	} else {
    		$args = array(
    			  'post_parent' => $topic_id, // ID of the topic
    			  'order'       => 'ASC', // Order of the replies (ASC or DESC)
    			);
    			
    			$replies_array = array();
    		
    			if ( bbp_has_replies( $args ) ) {
    			  while ( bbp_replies() ) {
    				bbp_the_reply();
    				$replies_array[] = array(
    				  'id' => bbp_get_reply_id(),
    				  'content' => bbp_get_reply_content(),
    				  'date' => bbp_get_reply_post_date(),
    				);
    			}
    		}
    			$response = array( 'status' => 'success', 'message' => $topic_id);
    	}
    	wp_send_json($response);
    }
Viewing 25 results - 826 through 850 (of 32,454 total)
Skip to toolbar