valarcher (@valarcher)

Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

  • valarcher
    Participant

    @valarcher

    yes thanks Robin for your incredible help — couldn’t have done it without you!


    valarcher
    Participant

    @valarcher

    I believe they slow down site loading, and often plugins are no longer supported with wordpress upgrades, where php in functions.php works forever so far in my experience 🙂


    valarcher
    Participant

    @valarcher

    Hi Robin – yes, if I do a ctrl-U on the forum page in bbpress, I see it. Oh I just clicked edit on each forum in wordpress and found it there and deleted it, so now they display correctly. I have *no* idea why astra adds all that junk html after title & descr, another bug!


    valarcher
    Participant

    @valarcher

    oh dear I was hoping not to use any plugins. I prefer just to add to functions.php but everything I’ve tested on this page so far, does not work: https://wordpress.stackexchange.com/questions/11717/prevent-users-from-changing-their-email-address.

    Astra has promised they’ll fix that bug with their next upgrade but then that would mean installing two plugins, so I’ll give up at this point. I’ll just remind users not to change their email.


    valarcher
    Participant

    @valarcher

    >wordpress profile or bbpress profile ?? There’s a bbpress profile? When I installed bbpress into astra wordpress theme, it displays the normal wordpress profile page when a person clicks on their name in the upper right, e.g. I added you as a forum participant:

    login at: https://greensmoothie.com/forums

    It’s that email I’d like to prevent users from changing.

    Where’s the bbpress profile?


    valarcher
    Participant

    @valarcher

    Hi Robin – do you perhaps have any solution to that code? I’m trying to grey out the user’s email on their profile page so they can see it but not be able to update it (same as username). But I need users to update other info like website and bio. That code above does not allow *any* edits to profile page. So my users are unable to write anything into their bio if I use that code.


    valarcher
    Participant

    @valarcher

    Problem is I need it to display like this:

    Challenge Question — Private
    What’s your number one challenge related to eating high-raw plant-strong?
    Edit | Close | Trash | View

    High-Raw Plant-Strong Life — Private
    Ask questions, share your knowledge of the high-raw plant-strong lifestyle
    Edit | Close | Trash | View

    And instead its displaying like this:

    Challenge Question — Private
    What’s your number one challenge related to eating high-raw plant-strong? <div id=”highlighter–hover-tools” style=”display: none;”> <div id=”highlighter–hover-tools–container”> <div class=”highlighter–icon highlighter–icon-copy” title=”Copy”></div> <div class=”highlighter–icon highlighter–icon-change-color” title=”Change Color”></div> <div class=”highlighter–icon highlighter–icon-delete” title=”Delete”></div> </div> </div> <div id=”highlighter–hover-tools” style=”display: none;”> <div id=”highlighter–hover-tools–container”> <div class=”highlighter–icon highlighter–icon-copy” title=”Copy”></div> <div class=”highlighter–icon highlighter–icon-change-color” title=”Change Color”></div> <div class=”highlighter–icon highlighter–icon-delete” title=”Delete”></div> </div> </div> <div id=”highlighter–hover-tools” style=”display: none;”> <div id=”highlighter–hover-tools–container”> <div class=”highlighter–icon highlighter–icon-copy” title=”Copy”></div> <div class=”highlighter–icon highlighter–icon-change-color” title=”Change Color”></div> <div class=”highlighter–icon highlighter–icon-delete” title=”Delete”></div> </div> </div>
    Edit | Close | Trash | View

    How do I tell bbpress to NOT display all that html?


    valarcher
    Participant

    @valarcher

    ignore this reply – don’t know how to delete it!


    valarcher
    Participant

    @valarcher

    Hi Robin – thanks million for renaming title. That php works perfectly. Sadly the other problem of 1/3-col doesn’t work addressing #bbpress-forums. It works if I target the entire page, then every forum title like this:
    #post-9486,#bbp-forum-9475,#bbp-forum-9473,etc {width:100%;}
    but the moderator doesn’t have access to css so won’t be able to add every forum to css when she creates it.

    I’ll carry on hounding astra for solution. Otherwise worst case scenario I just set blog archives to 1 column.

    While I have you… your code here:
    /** bbPress: add description under forum titles
    https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ */

    function rw_singleforum_description() {
      echo '<div class="bbp-forumpage-content">';
      echo bbp_forum_content();
      echo '</div>';
    }
    add_action( 'bbp_template_before_single_forum' , 'rw_singleforum_description');

    You have the first echo as “bbp-forum-content” but by changing it to “forumpage-content”, we’re able to target the description on index page and description on forum page separately in css, eg. on forum pages I have it red bold and centered, whereas on index page I have it in regular left-aligned text.

    Thanks million for all the work you put into the codex! I’m not keen on installing plugins such as your style pack, so codex is really helpful finding just the php I need.

    Do you perhaps have any solution to this code? I’m trying to grey out the user’s email on their profile page so they can’t update it. But I need users to update other info like website and bio. However with code below, if I test writing words in bio (as a logged in participator, not as keymaster) and try saving it, I get “Error: Please enter an email address.” I can see the email greyed out there.

    Do you know a way to fix it so ONLY the email and role can NOT be changed (although role does not even display on a participant user’s page) and everything else can be edited? (except for username of course)

    /** bbPress/WP: prevents subscriber from changing email (greyed out)
    https://www.role-editor.com/hide-disable-wordpress-user-profile-fields/ */

    add_action('admin_init', 'user_profile_fields_disable');
    function user_profile_fields_disable() {
    global $pagenow;
    // apply only to user profile or user edit pages
    if ($pagenow!=='profile.php' && $pagenow!=='user-edit.php') {
    return;
    }
    // do not change anything for the administrator
    if (current_user_can('administrator')) {
    return;
    }
    add_action( 'admin_footer', 'user_profile_fields_disable_js' );
    }
    /**
    * Disables selected fields in WP Admin user profile (profile.php, user-edit.php)
    */
    function user_profile_fields_disable_js() {
    ?>
    <script>
    jQuery(document).ready( function($) {
    var fields_to_disable = ['email', 'role'];
    for(i=0; i<fields_to_disable.length; i++) {
    if ( $('#'+ fields_to_disable[i]).length ) {
    $('#'+ fields_to_disable[i]).attr("disabled", "disabled");
    }
    }
    });
    </script>
    <?php
    }

    I know nothing about php – other than simple stuff like seeing I can change forum-content to forumpage-content!


    valarcher
    Participant

    @valarcher

    Hi Robin – I’m using astra, it’s id=”post-9486″ and
    <h1 class=”page-title ast-archive-title”>Forums</h1>

    Is there a way in functions.php to tell astra to display that title as “Private Forums”?

    While I’ve got your attention 🙂 is there a way in functions.php to tell everything in [bbp-forum-index] to be:
    {width:100%;}

    I need my blog archives set to 3-col but Astra treats blog and forum archives as the same, so to get forum index to display full-width, I have to set my blog archives to 1-column in Astra settings.

    Please could you give me the php for functions.php that will display [bbp-forum-index] as width:100% so it over-rides the 3-column setting I need in astra for blog archives?


    valarcher
    Participant

    @valarcher

    but problem is not with forums – they display full-width – it’s with forum index/archives. Problem is the forum index is treated as blog archives. I need 3-col blog archives for the rest of my site and 1-col for forum archives.
    I tried entering the shortcode [bbp-forum-index] on the /members page — which is set to full-width in css as above — but that doesn’t solve the problem of the index of forums displaying only in col 1 of the 3-col grid I’m using for blog archives. To get them to display full-width I have to target each individually in the index, e.g. #bbp-forum-9475.
    I know the quick but ugly fix is to set all my blog archives to 1-col (that is, full width) but I’m looking for the beautiful fix of setting only my forum archives to 1-col. Is there any way to do this?


    valarcher
    Participant

    @valarcher

    thank you! Just did functions.php for now – works great! But good to know about bbp-style-pack for future, thanks!


    valarcher
    Participant

    @valarcher

    Wow that seems like a complex solution to something that the codex says is a simple checkmark next to Settings > Forums > Forum Features

Viewing 13 replies - 1 through 13 (of 13 total)