Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,026 through 2,050 (of 32,466 total)
  • Author
    Search Results
  • #217309

    In reply to: Avatar issues

    neon67
    Participant

    try to css:

    #bbpress-forums .widget_display_replies img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar
    {display:none !important;}
    #217300

    In reply to: Moving Breadcrumbs

    andyinspired
    Participant

    Thank you, works great, it was indeed page.php.

    However, I’m trying to display the page title as well using:

    <?php the_title(); ?><?php bbp_breadcrumb(); ?>

    It works on all child pages but not on the homepage, I’ve also tried adding it to the index.php file but without success. I know the breadcrumbs won’t display there I just want the title there to keep it consistent with the rest of the site.

    Any ideas?

    #217287

    In reply to: Moving Breadcrumbs

    Robin W
    Moderator

    if you want the bbpress breadcrumb in the forums, then you would need to find out which theme template astra is using to display the forum page.

    You would then use this template and rename to bbpress.php and add the breadcrumb back which is what I think the first link you quoted was trying to do.

    This plugin will tell you which tempate is being used

    What The File

    and then (presuming you are using a child theme) you would copy that template (quite often page.php) and rename it bbpress.php.

    you would then add

    <div class="truebreadcrumbs"><?php bbp_breadcrumb(); ?></div>

    in the appropriate place in that file

    #217286

    In reply to: Moving Breadcrumbs

    andyinspired
    Participant

    I’m using the Astra theme (https://wpastra.com/), I’m comfortable writing CSS and editing PHP code. Just wasn’t sure if there was a filter I could use or whether I need to edit a template?.

    Thanks.

    #217276

    In reply to: Moving Breadcrumbs

    Robin W
    Moderator

    looking at that suggestion, not sure what 1 & 2 are trying to do – not a section I wrote !

    so to move them out of bbpress, then yes, use css and do this

    div.bbp-breadcrumb {
     display: none; /*this will hide all breadcrumbs*/
     }

    put this in your theme’s custom css file.

    The other part will be theme dependant – are you creating a theme or using an existing one?

    #217273
    andyinspired
    Participant

    Hi,
    I’m trying to move the breadcrumbs out of the forum container and to the top of the page as explained in the codex here:
    http://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#7-how-can-i-remove-all-the-breadcrumbs-from-the-templates-and-set-them-at-the-top-of-the-page

    However, if I create a bbpress.php file (or copy the one from the plugins folder) in the root of my child theme it breaks the forum completely!.

    Any help appreciated!

    Thanks.

    #217271
    Robin W
    Moderator

    the easiest way is

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topics Index Styling and tick item 16 don’t show this message

    if you want to do it using FTP then

    find
    wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-topics.php

    transfer this to your pc and remove

    <div class="bbp-template-notice">
    	<ul>
    		<li><?php esc_html_e( 'Oh, bother! No topics were found here.', 'bbpress' ); ?></li>
    	</ul>
    </div>

    and save (this file must exist, but we just make it empty!)

    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/feedback-no-topics.php

    bbPress will now use this template instead of the original

    #217218
    Robin W
    Moderator

    my mistake should be

    main a {
    	text-decoration: underline !important;
    }
    a.bbp-topic-permalink { 
            text-decoration: none !important;
    }
    #217216
    uksentinel
    Participant

    removed all CSS code and replaced it with you code as above, alas this did not work, maybe an conflict with theme ?

    #217214

    In reply to: User Statistics

    Robin W
    Moderator

    Anyone coming new to this thread, I have added a revised version of this plugin to my site which can be downloaded from

    bbpress-improved-statistics-users-online

    This plugin is one which WordPress withdrew as it violated their guidelines (suspected to be listing users without login, but not certain).

    You can download and use, but I offer no support or warranty that this code works !

    #217213
    Robin W
    Moderator

    ok your code is

    main a {
    	text-decoration: underline !important;
    	a.bbp-topic-permalink { text-decoration: none: !important;
    	}: ;
    }

    it should be

    main a {
    	text-decoration: underline !important;
    }
    a.bbp-topic-permalink { 
            text-decoration: none: !important;
    }
    #217212
    uksentinel
    Participant

    and new code is still in

    #217210
    uksentinel
    Participant

    Yes, original code is still there, I did notice when I pasted in the new CCS code, the a.bbp-topic-permalink changed to a red colour ?

    #217208
    uksentinel
    Participant

    Hi Robin

    I placed code both above and below original CSS alas did not work, I assume because original css has priority ?

    #217203

    In reply to: User Statistics

    Robin W
    Moderator

    so in the statsistics plugin you are changing

    $latest_user = get_users(
                    array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC",
    		'meta_key' => 'wp-approve-user',
    		'meta_value' => '1'
                    )
                );

    to

    //set up $args with core arguments needed
    $args =  array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC",
    		) ;
    		
    //add additional meta data to $args if wp-approve-user is active
    if (class_exists ('Obenland_Wp_Approve_User')) {
    	$args ['meta_key'] = 'wp-approve-user' ;
    	$args ['meta_value'] = '1' ;
    }	
    
    //then do the lookup
    $latest_user = get_users($args) ;
    
    #217199

    In reply to: User Statistics

    Robin W
    Moderator

    ok, so final amendment needed, as if you deactivate wp-approve-user then the latest user will be forevermore the last one you approved before decativating the plugin.

    If you open the wp-approve-plugin you’ll see the core file wp-appprove-user.php

    open this and you’ll see a line 29 which says

    class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_V4 {

    so we know that the wp-approve-plugin sets up a class called ‘Obenland_Wp_Approve_User’, so we can use the existence of this class to know if wp-approve-use is active or not.

    This is common to many plugins and a good way to ensure parts of code that use another plugin only fire if that plugin is active.

    so now we can change the ‘get_uses’ to only add the meta_data is the class exists

    //set up $args with core arguments needed
    $args =  array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC",
    		) ;
    		
    //add additional meta data to $args if wp-approve-user is active
    if (class_exists ('Obenland_Wp_Approve_User')) {
    	$args ['meta_key'] = 'wp-approve-user' ;
    	$args ['meta_value'] = '1' ;
    }	
    
    //then do the lookup
    $latest_user = get_users($args) ;
    #217194
    Robin W
    Moderator

    try

    a.bbp-topic-permalink {
    text-decoration: none: !important;
    }

    I’d add this after your css lines above.

    #217193
    Robin W
    Moderator

    I am just a guy who sites in his kitchen and writes code for enjoyment, and I like to try and help others on the forums.

    I do not get paid to do this, I have no connection with bbpress and all code (inc wordpress and bbpress) is offered under OSF, which is that it is free, open source to allow others to amend it, and offered with no support and no warranty that it does anything.

    bbpress authors are free to decide what they put in their code, as am I. I do not suggest what should be in bbpress, nor do I consider that they should take any notice of me.

    The topics for posts plugin has not been updated for a while because the authors do not choose to do so, that is their right, it is free code offered at the point of publishing. You are free to learn php and update and amend it as you wish.

    I am not author of topics for posts, I have just been granted access as I wish to update it, which I will do when I am ready to do so.

    #217191

    In reply to: User Statistics

    Robin W
    Moderator

    ok, so the function within that code that gets the latest user is this

     $latest_user = get_users(
                    array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC"
                    )
                );

    so this function brings users ordered by registered – DESC means latest is listed first, and number=>1 means just retrieve one, so this gets the latest.

    so we just need to add a lookup to say that this must also have meta ‘wp-approve-user’ set to 1 so we amend the function to

     $latest_user = get_users(
                    array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC",
    		'meta_key' => 'wp-approve-user',
    		'meta_value' => '1'
                    )
                );

    This (untested) should work for your site.

    I don’t plan to support this plugin, but am happy to have it on my site to allow others to use it.

    Given that many many other plugins might set meta data it is not possible to cater for all, so I’ll just host the previous version. Anyone downloading will be via this thread so they can see how to update it to cater for the approve plugin.

    #217190

    In reply to: User Statistics

    Chuckie
    Participant

    I have just checked the database and wp-approve-user is always 1 with the exception of one record where it is empty. I assume this is the person that registered on my site this morning whom I have not approved.

    so we just need the latest user who has been approved

    Correct, but, if this will be part of the plugin you sponsor on your site it will need to factor if for the old way I guess too. Unless this becomes a custom code change just for me.

    #217188

    In reply to: User Statistics

    Robin W
    Moderator

    that was exactly what I meant – now we know what changes, so to code we need to find out which user is being displayed and get that data.

    so as you say it will be something like

    $approve = get_meta_data ($user_id, 'wp-approve-user', true) ;

    presume you mean ‘latest user’ – not keen to load the plugin to my test site as I’m mid something else – so we just need the latest user who has been approved, or do you mean something else?

    #217187

    In reply to: User Statistics

    Chuckie
    Participant

    So it calls:

            private function section_latestuser() {
                
                // Grab the latest registered user on the site
                return $this->tag_replace( $this->parent->option["title_text_latestuser"] );
            }
    

    Which in turn calls:

    
            function get_latestuser( $html ) {
                $latest_user = get_users(
                    array(
                        'number' => 1,
                        'fields' => array("user_login", "ID", "display_name"),
                        'orderby' => "registered",
                        'order' => "DESC"
                    )
                );
                
                $latest_user = reset( $latest_user );
                
                // Default display is the full name
                $name = $latest_user->display_name;
                
                if( $this->parent->option['user_display_format'] == "display_as_username" ) {
                    $name = $latest_user->user_login;
                }
                
                if( $html == true ) {
                    return "<a href=\"" . bbp_get_user_profile_url( $latest_user->ID ) . "\">" . $name . "</a>";
                } else {
                    return $name;
                }
            }
    

    I think, if “WP Approve User” is installed then we need to somehow modify the array returned to only include those where the are approved (as per my previous email).

    #217186
    uksentinel
    Participant

    I am running a little custom CSS custom code to underline all my Hyperlinks on my BBPRESS forum, which work well, but I now wish to not underline Topics – can anybody advise addition code needed ?

    Thanks:

    main a {
    text-decoration: underline !important;
    }

    Site: uktechhub.com

    #217181

    In reply to: User Statistics

    Chuckie
    Participant

    Further to last message, I don’t know if the code I showed you can be improved?

    As mentioned, I have “WP Approve User” installed. I have checked the meta data for a given user in the database and if “wp-approve-user” is not set to “1” then they should not be listed in the “newest users” bit of the statistics.

    That “build_html” code needs to be modified somehow.

    multi65
    Participant

    I see…so there is no way to relocate the form to another page with free code?

Viewing 25 results - 2,026 through 2,050 (of 32,466 total)
Skip to toolbar