Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,476 through 2,500 (of 32,462 total)
  • Author
    Search Results
  • #213350

    In reply to: Login URL

    Robin W
    Moderator

    given that you don’t understand code, then the best I can offer is to remove the bbpress login from the topic and reply forms.

    This can be done by installing

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topic/Reply Form and activate item 15

    #213345

    In reply to: Login URL

    Robin W
    Moderator

    sorry, bbpress uses the standard wordpress login api, so it is code if you want to do something different

    #213342

    In reply to: Login URL

    Mushlih Almubarak
    Participant

    Sorry, I don’t really understand code, is there another way? Or can you simplify your explanation?
    Thank you very much

    #213339
    Robin W
    Moderator

    hmm – I just added that code to my test site, and it works fine with 2.6.5

    #213338
    Oleksandr
    Participant

    I use the next code in functions.php

    add_filter('bbp_get_topic_post_type_supports', 'register_bbpress_topic_type_supports');
    function register_bbpress_topic_type_supports( $args ) {
    	$args[] = 'excerpt';
    	$args[] = 'thumbnail';
    	$args[] = 'custom-fields';
    	return $args ;
    }
    #213332
    Robin W
    Moderator

    ok I suspect you are talking about wordpress post custom fields.

    if so, bbpress has never natively supported these, so I suspect you have code or an additional plugin such as acf or a bbpress plugin that is doing this.

    #213326
    Robin W
    Moderator

    sorry neither ‘standard custom field’ or the image means anything to me – perhaps you could say whether this is code a plugin or where you are seeing this or what you are trying to do etc.

    #213322
    Robin W
    Moderator

    ok, can you start by saying what you mean by ‘custom field’ – is this some code, a plugin or what ?

    Oleksandr
    Participant

    Custom Field doesn’t work with bbpress 2.6 and above
    I use custom fields for bbpress topics.
    I tried to turn off all plugins and change the theme to default but always receive next javascript error in the console:

    load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,suggest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse&ver=5.3.1:4 POST https://test.3d-kstudio.com/wp-admin/admin-ajax.php 400
    send @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,suggest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse&ver=5.3.1:4
    ajax @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,suggest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse&ver=5.3.1:4
    ajaxAdd @ load-scripts.php?c=0&load[chunk_0]=hoverIntent,common,hoverintent-js,admin-bar,wp-ajax-response,jquery-color,wp-lists,jquery-ui-sortable,postbox,jquery-ui-position&load[chunk_1]=,jquery-ui-menu,jquery-ui-autocomplete,tags-suggest,tags-box,word-count,wp-sanitize,post,editor-expand,thickbox,shortcode,backbo&load[chunk_2]=ne,wp-util,wp-backbone,media-models,wp-plupload&ver=5.3.1:9
    i.wpList.<computed> @ load-scripts.php?c=0&load[chunk_0]=hoverIntent,common,hoverintent-js,admin-bar,wp-ajax-response,jquery-color,wp-lists,jquery-ui-sortable,postbox,jquery-ui-position&load[chunk_1]=,jquery-ui-menu,jquery-ui-autocomplete,tags-suggest,tags-box,word-count,wp-sanitize,post,editor-expand,thickbox,shortcode,backbo&load[chunk_2]=ne,wp-util,wp-backbone,media-models,wp-plupload&ver=5.3.1:9
    (anonymous) @ load-scripts.php?c=0&load[chunk_0]=hoverIntent,common,hoverintent-js,admin-bar,wp-ajax-response,jquery-color,wp-lists,jquery-ui-sortable,postbox,jquery-ui-position&load[chunk_1]=,jquery-ui-menu,jquery-ui-autocomplete,tags-suggest,tags-box,word-count,wp-sanitize,post,editor-expand,thickbox,shortcode,backbo&load[chunk_2]=ne,wp-util,wp-backbone,media-models,wp-plupload&ver=5.3.1:9
    dispatch @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,suggest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse&ver=5.3.1:3
    r.handle @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,suggest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse&ver=5.3.1:3
    #213314
    bobwhallz
    Participant

    Hi
    I have a transparent header built with Astra theme and Elementor page builder. I am also using BuddyPress on my site.

    I would like to change all the bbpress forum pages header to a different background color, none white, so the header menu can display properly.

    What css codes should i use?
    Bbpre Version 2.6.5 on latest WordPress installation
    Thank you

    #213311

    In reply to: Login URL

    Robin W
    Moderator

    so what should the url be ?

    I’ll then give you some code

    #213283
    malinky
    Participant

    Thanks for this Robin but unfortunately it didn’t work.

    After I ran the code the message was…
    Topics fixed…
    Replies fixed…
    All done…
    Total topics:2530
    Topics with no post_parent:33
    Total replies: 19274
    Replies with no post_parent:19273

    I ran the code twice (removing it and following the same process again), but the result was the same.

    #213276
    Robin W
    Moderator

    ok, I’ve re-written a bit just in case

    can you

    BEFORE DLOING THIS backup your site or have the ability to go back to a previous version

    1.deactivate and delete the existing plugin
    2. download this plugin

    fix forum import post parent

    3. install and activate
    4. create a page called whatever you like, and put the shortcode
    [fix-import]
    in it
    5. view the page – you should be able to see how many topics have blank post_parent before running.
    6. If you are happy – run this.

    #213266
    malinky
    Participant

    I ran that but it didn’t fix the issue.

    Strangely, the Replies page in the admin says there are over 19,000 replies but only two are showing up now. The others are no longer visible.

    Is it possible to run the code again but just for the replies? Maybe it was a memory limit issue. I’ve just upped the max_memory_limit to 256M.

    #213263
    lonelydime
    Participant

    It’s been about 10 years since I’ve attempted anything WordPress or PHP for that matter, but while this works it feels like it’s going to break in an update.

    add_filter( 'bbp_default_styles', 'rew_dequeue_bbpress_css' );
    
    function rew_dequeue_bbpress_css ($defaults ){
    	fixed_bbp_enqueue_style("bbp-default", "css/bbpress.css", array(), bbp_get_version());
    	unset ($defaults['bbp-default']) ;
    	return $defaults ;
    }
    
    function fixed_bbp_enqueue_style( $handle = '', $file = '', $deps = array(), $ver = false, $media = 'all' ) {
            // Attempt to locate an enqueueable
            $located = bbp_locate_enqueueable( $file );
    	$located = str_replace('/bitnami/wordpress', '', $located);
    		
            // Enqueue if located
            if ( ! empty( $located ) ) {
    
                    // Make sure there is always a version
                    if ( empty( $ver ) ) {
                            $ver = bbp_get_version();
                    }
    
                    // Make path to file relative to site URL
                    $located = bbp_urlize_enqueueable( $located );
    
                    // Register the style
                    wp_register_style( $handle, $located, $deps, $ver, $media );
    
                    // Enqueue the style
                    wp_enqueue_style( $handle );
            }
    
            return $located;
    }

    From what I can tell your snippet does, it just clears out the default css object so the loop to bbp_enqueue_style skips including it and then I can inject my own function. The scripts function seem more complicated because there are many more includes than one file and they’re based on pages from what I can tell. Is what I’ve done what you were referring to?

    #213246
    Robin W
    Moderator

    ok, that should have worked for replies as well – let me take another look at the code

    #213228
    Robin W
    Moderator

    I think I might know the issue.

    can you

    1. backup your site or have the ability to go back to a previous version
    2. download this plugin

    Fix forum


    3. install and activate
    4. create a page called whatever you like, and put the shortcode
    [fix-topics]
    in it
    5. view the page, select ‘run’ and click submit

    your topics and replies should now be fixed.

    #213186
    Robin W
    Moderator

    you can dequeue from bbpress and then reload as you wish

    so for styles

    add_filter( 'bbp_default_styles', 'rew_dequeue_bbpress_css' ) ;
    
    function rew_dequeue_bbpress_css ($defaults ){
    unset ($defaults['bbp-default']) ;
    return $defaults ;
    }

    and re-enqueue it using your own function

    #213185
    Robin W
    Moderator

    ok, thanks, but sorry I can’t really help further.

    I will state again that WordPress handles both registration and login, and as long as you don’t use the login widgets or shortcodes then bbpress should not be involved.

    I hope you get a resolution

    #213181
    lonelydime
    Participant

    Hello,

    I’m running a fresh install of WordPress from the bitnami helm chart using persistent storage on an NFS share. The path used by the containers is /bitnami/wordpress/wp-content/ to pull in plugins/etc. When I install bbPress, all of the css files and js files use the wrong path to include the assets.

    Here’s an example:

    <link rel='stylesheet' id='bbp-default-css' href='https://example.com/bitnami/wordpress/wp-content/plugins/bbpress/templates/default/css/bbpress.min.css'>
    
    <script type='text/javascript' src='https://example.com/bitnami/wordpress/wp-content/plugins/bbpress/templates/default/js/editor.min.js?ver=2.6.5'>

    I haven’t had any issues with other plugins thus far, but for some reason bbPress is wanting to use the full installation path instead of the web root. Is there a way of fixing this with some WP constant that I’m not setting? The installation of wordpress is in /opt/bitnami/wordpress and wp-content/ and wp-config.php are symlink’d to /bitnami/wordpress/wp-content and /bitnami/wordpress/wp-config.php.

    I have a temporary fix right now which will be wiped out when bbPress updates.

    File: wp-content/plugins/bbpress/includes/core/template-functions.php

    function bbp_enqueue_style( $handle = '', $file = '', $deps = array(), $ver = false, $media = 'all' ) {
            // Attempt to locate an enqueueable
            $located = bbp_locate_enqueueable( $file );
            //Ghetto fix
            $located = str_replace('/bitnami/wordpress', '', $located);
    function bbp_enqueue_script( $handle = '', $file = '', $deps = array(), $ver = false, $in_footer = false ) {
            // Attempt to locate an enqueueable
            $located = bbp_locate_enqueueable( $file );
            //Ghetto fix
            $located = str_replace('/bitnami/wordpress', '', $located);
    #213177
    haddlyapis
    Participant

    Hey there, I tried using the translation part of the bbp style pack plugin, while assuming, that once I was able to fix the translations I would then fix the CSS styling issues I have mentioned above (this would just take a little work on my behalf). Anyway, even though it says you have to play around with it to get it right (e.g. add the full stop if there is one etc.), I was not able to implement the translations. I am sure it has something to do with the way my site is set up and not the plugin itself, but alas, I had to find a different option.
    So, here is my frontend Javascript solution. I noticed that I have to put e.g. “weeks” before “week” in the object for it to work (i.e. plural before singular). For anyone who wants to know, the word “aktualisiert” refers to the English word “updated”, (as the verb goes to the end of the sentence in German it is slightly tricky to just translate “this was last updated…..”).
    I am not sure if anyone needs this, but as I require help with my website from time to time from people like those at bbpress (thx btw), if I can be of any help, I would like to. This is an IIFE btw:

    
    /* WB- translate some dodgy sentences (part English/ part German) */
    var translate = function () {
        //check if the page is a forum page. If not, return function
        var isForum = document.querySelector("#bbpress-forums");
        if (!isForum) return;
    
        // find if either forum or topic description (topic is one level lower in the forum where people can answer individual posts. forum is where all the sub-topics are listed
        var forum = document.querySelector(".bbp-forum-description");
        var description = document.querySelector(".bbp-topic-description");
    
        //If not on either the forum description page or the forum topic page, return
        if (!forum && !description) return;
    
        //set a variable to add the innerHTML to 
        var d_text;
    
        if (forum) {
            // if forum has no topics make no tranlation changes and hide the "Oh bother.... div"
            if (forum.innerText === "Dieses Forum ist leer."){ 
            var oh_both_text = document.querySelectorAll(".bbp-template-notice");
            oh_both_text[1].style.display = "none";
            return;
        }
            d_text = forum.innerHTML;
        }
        if (description) {
            d_text = description.innerHTML;
        }
    
        // create object with list to translate (name: = English, value = Deutsch)
        var d_obj = {
            "This forum has": "Dieses Forum hat",
            "This topic has": "Dieses Thema hat",
            "This category has":"Diese Kategorie hat",
            "This topic is empty":"Dieses Thema ist leer",
            "hidden":"verdeckt",
            "and was last updated": "und wurde zuletzt",
            "seconds": "Sekunden",
            "minutes": "Minuten",
            "hours": "Stunden",
            "days":"Tagen",
            "day": "Tag",
            "weeks":"Wochen",
            "week": "Woche",
            "months": "Monaten",
            "month": "Monat",
            "years":"Jahren",
            "year":"Jahr",
            "by": "von"
        }
    
        // use Replace method to run through innerHTML and replace English text with German
        d_text = d_text.replace(/This forum has|This topic has|This category has|This topic is empty|hidden|and was last updated|seconds|minutes|hours|days|day|weeks|week|months|month|years|year|by/gi, function (matched) { return d_obj[matched]; });
    
        //add "aktualisiert" to end of sentence
        if (d_text.indexOf("und wurde zuletzt") > -1) {
        d_text = d_text.slice(0,-1).concat(" aktualisiert.");    }
    
        //update the innerHTML of either the forum or the topic page 
        if (forum) { forum.innerHTML = d_text; }
        if (description) { description.innerHTML = d_text; }
    }();
    
    #213153
    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php

    transfer this to your pc and edit

    you’ll see

    		<?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( ! bbp_is_forum_category() ) : ?>
    
    			<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>

    change this to

    <?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>
    		
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    			
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			
    
    		<?php elseif ( ! bbp_is_forum_category() ) : ?>
    		
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    			<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>

    and save

    then 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/content-single-forum.php

    bbPress will now use this template instead of the original, and the topic form will now appear before the forums

    Robin W
    Moderator

    that is a question – you should only have it once, either in your theme function file or in code snippets not in both !

    torimc125
    Participant

    Hi Robin: Thank you again for your reply.  I copied the code you provided and pasted it into Code Snippets. Now I get this error message: 

    “The snippet has been deactivated due to an error on line 3:
    Cannot redeclare function to_archive_title_remove_prefix.

    Any other suggestions?
    Victoria

    #213118
    Robin W
    Moderator

    Viewing a single topic
    if (bbp_is_single_topic()) {...
    and or

    Check if current page is a bbPress topic
    bbp_is_topic()

    and also
    Check if we are viewing a topic archive.
    bbp_is_topic_archive()

    and
    Check if current page is a topic edit page
    bbp_is_topic_edit()

Viewing 25 results - 2,476 through 2,500 (of 32,462 total)
Skip to toolbar