Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,076 through 1,100 (of 32,491 total)
  • Author
    Search Results
  • #230577
    kwk
    Participant

    It’s a pleasure to have people like you,@robin-w, around to get things fixed and get the job done. I’m still playing with the above CSS code and it is producing positive results. Thanks a bunch.

    #230570
    Robin W
    Moderator

    A lot of mobile changes depend on the theme being used.

    These are the css changes that this site uses for smaller devices

    /* Do not fix #header for non-desktops */
    @media screen and ( max-width: 782px ) {
    	#header {
    		top: 0;
    		z-index: 99999;
    		position: absolute;
    	}
    	#wpadminbar {
    		z-index: 88888;
    		height: 56px !important;
    		position: absolute;
    	}
    	#wp-toolbar {
    		width: 100%;
    	}
    	#main {
    		margin: 100px 10px 40px 10px;
    	}
    	body:not(.trac):not(.home-page) #main {
    		margin-top: 140px;
    	}
    	#footer {
    		padding: 10px;
    		margin: 10px;
    	}
    	#footer div.links,
    	#footer div.details {
    		float: none;
    		margin: 10px 0;
    	}
    	#bb-menu-icon,
    	#mobile-menu-button {
    		display: block;
    		position: absolute;
    		right: 0;
    		padding: 33px 20px 33px 33px;
    		text-decoration: none;
    	}
    	#header #nav,
    	#wporg-header #wporg-header-menu {
    		margin: 0;
    		float: right;
    		overflow: visible;
    	}
    	#header #bb-nav,
    	#wporg-header #wporg-header-menu {
    		position: absolute;
    		width: 100%;
    		right: 0;
    		top: 81px;
    		border-bottom: 1px solid #aaa;
    	}
    	#header #bb-nav li,
    	#wporg-header #wporg-header-menu li {
    		width: 100%;
    		text-align: center;
    		margin: 0;
    		padding: 0;
    	}
    	#header #nav #bb-nav li a,
    	#wporg-header #wporg-header-menu li :link,
    	#wporg-header #wporg-header-menu li :visited {
    		display: block;
    		margin: 0;
    		padding: 20px;
    		color: #000;
    		text-shadow: none;
    		border-radius: 0;
    	}
    	#header #nav #bb-nav li.current a,
    	#header #nav #bb-nav li a:hover {
    		color: #fff;
    	}
    	#header #bb-nav,
    	#bbpress-forums .bbp-pagination-count,
    	.bbp-topic-meta,
    	#wporg-header #wporg-header-menu {
    		display: none;
    	}
    	#header #nav:hover #bb-nav,
    	#header #nav:focus #bb-nav,
    	#wporg-header #wporg-header-menu.toggled {
    		background-color: #eee;
    		display: block !important;
    	}
    	#wporg-header #wporg-header-menu.toggled {
    		background: #eee;
    	}
    	#header #nav:hover #bb-menu-icon:before,
    	#header #nav:focus #bb-menu-icon:before,
    	#wporg-header #mobile-menu-button[aria-expanded="true"]:before {
    		color: #fff;
    	}
    	#wp-admin-bar-my-account img.avatar {
    		height: 38px !important;
    		width: 38px !important;
    	}
    }
    
    /* Mobile */
    @media only screen and (max-width: 480px) {
    	#bbpress-forums div.bbp-topic-author img.avatar,
    	#bbpress-forums div.bbp-reply-author img.avatar {
    		width: 72px;
    		height: 72px;
    		margin: -5px 0 0 -5px;
    		transform: rotate(-5deg);
    	}
    
    	#bbpress-forums .bbp-author-role {
    		border: none;
    		background: transparent;
    		padding: 0;
    		margin: 0;
    	}
    
    	#bbpress-forums p.bbp-topic-post-date,
    	#bbpress-forums p.bbp-reply-post-date {
    		position: absolute;
    		right: -13px;
    		top: -17px;
    		font-size: 10px;
    		margin: 0;
    	}
    
    	#bbpress-forums div.bbp-topic-author .bbp-author-avatar + br,
    	#bbpress-forums div.bbp-reply-author .bbp-author-avatar + br,
    	#bbpress-forums div.bbp-topic-ip,
    	#bbpress-forums div.bbp-reply-ip {
    		display: none;
    	}
    
    	#bbpress-forums li.bbp-body div.type-topic span.bbp-admin-links,
    	#bbpress-forums li.bbp-body div.type-reply span.bbp-admin-links {
    		display: block !important;
    		border-top: 1px dotted #ddd;
    		margin: 10px 10px 0 10px;
    		padding: 5px 0;
    		position: relative !important;
    		top: 0;
    		left: 0;
    	}
    }

    You can play with them to get your site looking nicer

    either add them to the custom css part of your theme, or use

    Code Snippets

    #230443
    rinh
    Participant

    Hi
    First, thanks for all the help so far with functions and filters! The forum is done, but there is one feature I missed from the old forum and that’s having the editor autoresize with the content. I think this may be out of scope for this plugin, but perhaps someone knows something.

    I looked around and it seems WordPress TinyMCE have this feature, but it’s not enabled. I did some terrible attempt (you’re allowed to laugh) to add it. Not only did it break my toolbar 1, but it didn’t work either

    function bbp_enable_visual_editor( $args = array() ) {
    	
        $args['quicktags'] = false;
        $args['teeny'] = false;
        $args['tinymce'] = array( 
        'tinymce' => array(
                'toolbar1' => 'formatselect, bold, italic, underline, strikethrough, blockquote, link, forecolor, bullist, numlist, alignleft, aligncenter, alignright, outdent, indent, undo, redo',
    	    'autoresize_min_height' => 100,
                'wp_autoresize_on'      => true,
                'plugins'               => 'wpautoresize',
            ), 
        );
    	
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    #230433
    Robin W
    Moderator

    no it’s my bad coding !!

    I hadn’t spotted that you were using a child theme.

    I add some code to pick up on this, and be back in the next day

    gtatar
    Participant

    Robin, your code change worked for new topics. Did you say we would need an additional code change for replies?

    rinh
    Participant

    Oh! I did not see that the code changed when I pasted it in here and the ‘;’ even disappeared. I kept retrying with the one in the documentation.

    Thanks again Robin, you’re awesome 🙂

    Robin W
    Moderator

    ok, so just looked the documentation says

    ‘& lt;’

    when it should say

    ‘<‘
    etc.
    This is just internet stuff between stating and interpreting.

    so if you copy the code in your first post, then this is the correct code to have.

    I’ll look to correct the documentation

    rinh
    Participant

    Thank you for trying.

    That’s odd.

    I’ve tried it again, and also in my functions.php instead of Code Snippets. It doesn’t say there’s any errors until I try to save it.
    I tried another theme as well and also to remove all other custom snippets I got, but the same result.

    Robin W
    Moderator

    just loaded that code to my test site, and it runs fine.

    suggest you delete and try it again

    rinh
    Participant

    Hi!
    I tried a snippet from this page: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#24-show-status-labels-for-bbpress-topics
    to get a label or icon for sticky topics.

    function rk_sticky_topics() {
     
       if ( bbp_is_topic_sticky() && !bbp_is_topic_closed() )
          echo '<span class="sticky">[Sticky]</span>';
    }
     
    add_action( 'bbp_theme_before_topic_title', 'rk_sticky_topics' );

    I get a fatal error with syntax error unexpected ‘;’ on the line starting with if.

    Thank you in advance

    #230409
    cathyskach
    Participant

    I tested this on our staging site. Switching out for the Twenty Twenty theme, the dates populated, so I presume the problem to be the theme. What advice do you have for a fix?

    PS: I tried taking out the short code on the member-only (parent) page to allow you access to the forum but it seems to still want a password.

    Cathy

    #230408
    coopersita
    Participant

    I haven’t made much progress. I tried adding a rewrite rule and changing from ‘users’ from ‘members’ to avoid rules clashing:

    function bbp_custom_author_rewrite(){
        add_rewrite_rule(
            "^forums/members/([^/]*)$",
            'index.php?bbp_user=$matches[1]',
            "top"
        );
    }
    add_action( 'init', 'bbp_custom_author_rewrite', 10);

    But I think I’m missing the part where the template uses the query var to load the correct content because I keep getting 404 errors.

    #230405
    chenryahts
    Participant

    BBpress keeps loading the empty index.php in the TwentyTwentyTwo Child theme I’m working on, which loads a WSOD.

    I can’t get any of the template filters to use one of the html files, so temporarily have it working with the index.php file as:

    wp_head();
    block_header_area();
    block_template_part( 'page-inner' );
    wp_footer();
    block_footer_area();

    And… its almost all working? But, this can’t be the right way to get it to use the new default page template in the block theme.

    Thoughts? Ideas? How can I get it to use the new theme templates?

    Thanks!

    #230370
    Robin W
    Moderator

    ok, so to restrict :

    dashboard>forums>all forums>edit the forum you want>right hand side you will find a box called ‘Forum Moderators’ add his name

    Then make him a participant.

    see thsi for role fresponsibilities

    bbPress User Roles and Capabilities

    I’m not sure that this wil let him create forums – but I suppose I would ask if he is that dangerous, maybe that’s something he should be asking you to do 🙂

    gtatar
    Participant

    Robin, I applied your code change. Will report results once I have them.

    #230348
    Robin W
    Moderator

    just taken a look, that theme is a ‘block theme’ the new way that themes are written.

    If you want to use it. come back and I’ll give you some code to try

    #230340
    Robin W
    Moderator

    ok, so page is now ok, but suspect from

    https://middleagedwitch.com/Forums/forum/general-discussion/

    that you have a capital F somewhere

    so either your permalink is ‘Forums’ or in

    dashboard>settings>forums>root forum slug you have ‘Forums’

    it needs to be lower case ‘forums’

    #230339
    Robin W
    Moderator

    ok, so I’m guessing you have a page called ‘Forum’ in which you have put the shortcode

    [bbp-forum-index]

    If so change the permalink on this page from ‘forum’ to ‘forums’ and it should all work

    ppoirier1995
    Participant

    Hi there,

    I’m trying to find a solution to the problem of participants being able to remove single topic tags by simply removing them from the “Tags” input field on the reply-to form.

    I’ve found this thread that clearly explains the issue

    Topic tags deleted by other participants


    and offers a solution that is unfortunately not working on my end.

    My form-reply.php currently has this line:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() )) : ?>
    which I tried to replace with:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) && current_user_can('moderate') ) : ?>
    to no avail.

    Has anyone solved this issue? Would love some guidance here! 🙂

    #230304
    coopersita
    Participant

    Is there a way to redirect all profile page links so they use the user id, instead of user login/nicename? Some users have their email as their username, so we want to hide it.

    So to go from
    /forums/users/{login}

    to
    /forums/users/{id}

    I was able to change the URLs so they point to the right place:

    function bbp_custom_author_link(  $url,  $user_id,  $user_nicename){
                $url = site_url()."/forums/users/".$user_id;
    	   return $url;
        }
        add_filter( 'bbp_get_user_profile_url', 'bbp_custom_author_link', 10, 3);

    But once you click on the link, you end up in a 404.

    janecarole
    Participant

    Thank you, Robin, that worked. So grateful for you! Please provide me the link you gave me before (on a different topic) so I can thank you meaningfully ($) for your research/coding for me!

    I ended up creating a link on my “Member Profile” page to the new “profile” page you had me create. (I did this so the user would still see WP-Members “Member Profile” page with its unique information.) I used Code Snippets to add your code.

    Not that you need to know this, but: Right after making this change, I had to restore my site because a plugin update (WP-Crontrol) broke the site, and it wouldn’t load. The restore fixed that problem, but caused a problem with my Wordfence connection which messed up my site log-in. It took a while to figure that one out, but after disconnecting and reconnecting Wordfence, I am back to normal (except for needing to make your change again 🙁 …). Plan to do that later.

    Robin W
    Moderator

    or might not – I’m trying to look at this in limited free time and trying not to get sucked into too deeper a code dive 🙂

    #230292
    rinh
    Participant

    Sorry for double post, but I got the toggle button back by adding wp_adv, as well as the image button. Full code below if anyone needs it too

    function bbp_enable_visual_editor( $args = array() ) {
      
        $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, image, wp_adv');
        $args['quicktags'] = false;
        $args['teeny'] = false;
    
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    For toolbar 2 I hid the unwanted buttons with CSS. I’m happy with the results 🙂 Still curious though if toolbar 2 can be customised, but it’s nothing necessary.

    #230290
    rinh
    Participant

    Hi,
    I’m trying to customise the toolbar in TinyMCE.

    Initially I just enabled the advanced one:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['teeny'] = false;
        $args['quicktags'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    I thought of adding a button for underline and it led to trying to get only what I needed in one toolbar:

    function bbp_enable_visual_editor( $args = array() ) {
      
        $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, strikethrough, forecolor, outdent, indent, undo, redo');
        $args['quicktags'] = false;
        $args['teeny'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    This is causing it to repeat some things in toolbar 2 (as well as the ability to toggle toolbar 2 on and off). I tried adding toolbar 2 to the code above, but then it goes back to default. I could stop there though and just add underline and the tools that’s in toolbar 1 by default, but I’m curious if I can customise things further.

    To my question:
    Is there a way to add everything in one toolbar and then disable toolbar 2?
    Or is there a way to get the toogle for toolbar 2 back when I’ve customised toolbar 1?

    I also tried enabling teeny which would’ve worked best, but then I lose the forecolor toolbar box so I’d need a way to add it back.

    Thanks in advance

    Robin W
    Moderator

    maybe it’s the if function, try

    add_action ('bbp_new_topic_post_extras', 'rew_spam_update_last_active', 10 ,1 ) ;
    
    function rew_spam_update_last_active ($topic_id) {
    	//this function tests if a new topic has been marked as spam by Akismet.  If so then the last active date will be wrong
    	//So we use topic walker to recalculate it
    	bbp_update_topic_walker ($topic_id,  '', 0, 0, true) ;
    	}

    It’s not the answer, but might help get to the solution problem

Viewing 25 results - 1,076 through 1,100 (of 32,491 total)
Skip to toolbar