Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 126 through 150 (of 32,334 total)
  • Author
    Search Results
  • #240763
    ttiefenbach
    Participant

    Thanks for the quick reply! Unfortunately, your code returned the topic’s title.

    That allowed me to narrow my search, though, and I was able to get the correct functions for my permalink structure:

    function my_filter_thumbnail_id( $thumbnail_id, $post = null ) {
    	if ( $post->post_type != 'topic' )
    		return $thumbnail_id;
    	
    	$forumid = bbp_get_topic_forum_id();
    	if ( $forumid == 6728 )
    		$thumbnail_id = 7091;
    
    	return  $thumbnail_id;
    }
    add_filter( 'post_thumbnail_id', 'my_filter_thumbnail_id', 20, 5 );
    

    I could probably use the bbp_get_forum_title() function to get the tiel to compare, like you suggested, but I went with just validating the ID since it was working.

    Thanks for your help!!

    #240761
    Robin W
    Moderator

    $forumname = bbp_get_forum_title( $post->forum_id );

    #240759
    ttiefenbach
    Participant

    I’m trying to get a default featured image to display using a filter of “post_thumbnail_id” in my child theme’s functions.php file. I’m able to add a default thumbnail for post_type of topic, but I’d like it to be a custom thumbnail based on the id, or name of the forum the topic is in. Here’s what I have so far:

    function my_filter_thumbnail_id( $thumbnail_id, $post = null ) {
    	if ( $post->post_type != 'topic' )
    		return $thumbnail_id;
    	
    	$forumname = get_forum_name( $post->forum_id );
    	if ( $forumname == "wellness")
    		$thumbnail_id = 7091;
    
    	return  $thumbnail_id;
    }
    add_filter( 'post_thumbnail_id', 'my_filter_thumbnail_id', 20, 5 );
    

    The issue is, “get_forum_name(),” is an undefined function. I’m not looking to override the default functions of bbPress, just be able to access the forum_id or forum_name from my theme’s functions.php file. Any help would be greatly appreciated! Thanks

    #240736
    Robin W
    Moderator

    bbpress just uses wordpress registration.

    Wordpress requires users to have an email address for various reasons, including password changing and resetting.

    Whilst this is certainly achievable with code, I do not know of any plugin that allows this.

    No-one sees the email address apart from WordPress admins and the user.

    Dean Scott
    Participant
    Field       Type    Collation  Null  Key  Default  Extra  Privileges
    post_parent  int(11)   NULL     YES    —    NULL      —    select,insert,update,references 
    Dean Scott
    Participant

    It’s in the OP.

    Can you confirm what type of constraint is present on the post_parent column? The error uses the word KEY, which is a constrained column. Obviously, it can’t be a PRIMARY key, since ID is PRIMARY and AUTO INCREMENT, so post_parent set as UNIQUE, INDEX, or other?

    Now, I can run SQL in phpMyAdmin directly addressing post_parent, as in SELECT * FROM wp_posts WHERE post_parent != 0 AND post_type = topics OR post_type = replies;
    and the result is a screen full of all topics and replies.

    Yet this particular query syntax: SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts FORCE INDEX (PRIMARY, post_parent) throws the “doesn’t exist” error, so it must have something to do with the properties of post_parent not being an INDEX? So, HOW to make it one, per the above question.

    #240730
    jlemee
    Participant

    I don’t understand why it’s not work.
    I have a function for topic links and function for answer (reply) links

    // change answer links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                        'reply'  => bbp_get_reply_to_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_reply_edit_link ( $r ),
                        'trash'  => bbp_get_reply_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }
    
    //change topic links displayed
    add_filter ('bbp_topic_admin_links', 'change_topic_admin_links' ) ;
    function change_topic_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_topic_admin_links', array(
                        'reply'  => bbp_get_topic_reply_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_topic_edit_link ( $r ),
                        'trash'  => bbp_get_topic_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }
    #240729
    Robin W
    Moderator

    so this should work, but looks like your function

    // change admin links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                    'edit'    => bbp_get_reply_edit_link   ( $r ),
    				//'move'    => bbp_get_reply_move_link   ( $r ),
    				//'split'   => bbp_get_topic_split_link  ( $r ),
    				'trash'   => bbp_get_reply_trash_link  ( $r ),
    				//'spam'    => bbp_get_reply_spam_link   ( $r ),
    				//'approve' => bbp_get_reply_approve_link( $r ),
    				'reply'   => bbp_get_reply_to_link     ( $r )
    
                    ), $r['id'] );
    return $r['links'] ;
    }
    #240727
    Robin W
    Moderator

    try

    add_filter ('bbp_get_reply_admin_links', 'change_admin_links' ) ;

    #240725
    jlemee
    Participant

    I found it on a bbpress support discussion because I only wanted you to keep the modify, edit and trash links. But the link to edit never worked, before or after adding this code

    Dean Scott
    Participant

    I’m looking directly at wp_posts table. post_parent key has matching values to post_type records (topics, replies) and verified by your code returning zero for any mismatches.

    I’ve also added a copy of my theme’s page.php (parent = Kyma, child = Frontech), renamed it bbpress.php, and put it in both parent and child root theme folders (unaltered, because there’s nothing in the theme interfering with the layout and placement of BBP). No change.

    Robin W
    Moderator

    hmmm…

    so have you actually looked at the database tables? or are you getting the status from my code?

    Dean Scott
    Participant

    I just discovered more at the end of the PHP error…

    LIMIT 0, 15 made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), bbp_has_replies, WP_Query->__construct, WP_Query->query, WP_Query->get_posts

    Is this helpful?

    Yes, I’ve switched to 2024 theme AND deactivated all plugs, one-by-one. Same error.

    #240721
    Robin W
    Moderator

    where did this code come from?

    #240718
    jlemee
    Participant

    bbp_get_topic_edit_link work but bbp_get_reply_edit_link not work, my page is blank, can you help me please ? (bbp_get_reply_to_link(), bbp_get_topic_edit_link() and bbp_get_reply_trash_link() works perfectly)

    // change admin links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                        'reply'  => bbp_get_reply_to_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_reply_edit_link ( $r ),
                        'trash'  => bbp_get_reply_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }

    thanks for your help

    #240690
    ncarring
    Participant

    Many thanks. I actually fixed it after a bit of Googling by installing the code snippets plugin, and installing a snippet to set the filter bbp_get_do_not_reply_address.

    This sounds even easier. Thanks!

    #240680
    teresaanderson
    Participant

    I just went back to my test site and it looks like I’m no longer having the issue. I didn’t make any changes to the code, so I’m not sure why it’s working now, but thanks again!

    #240644

    In reply to: Error: Discussion page

    Robin W
    Moderator

    ok, I suspect the theme authors are being less than helpful.

    If you are able to FTP can you send me this file

    nombreweb/wp-content/themes/classiadspro/includes/actions/general.php

    via

    Contact me

    #240633
    Robin W
    Moderator

    That’s great – thank you.

    This error says that it is within the plugin directorypress

    Call to a member function is_built_with_elementor() on bool in

    /homepages/25/d981722677/htdocs/clickandbuilds/nombreweb/wp-content/plugins/directorypress/includes/directorypress_functions.php:

    but below seems to indicate it is having a problem with the bbpress template

    /template-loader.php

    But that does not mean it is the fault of directorypress, or indeed bbpress !

    There are 2 methods of getting bbpress to display

    which method are you using in this guide

    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ item 3

    #240626

    In reply to: TinyMCE not showing

    Robin W
    Moderator

    this is a known bug.

    either

    if( !function_exists( 'bbpress_browser_supports_js' ) ){
    	function bbpress_browser_supports_js() {
    		echo '<script>document.body.classList.remove("no-js");</script>';
    	}
    	add_action( 'wp_footer', 'bbpress_browser_supports_js' );
    } 

    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

    or

    #240625
    Uriahs Victor
    Participant

    I don’t know why, but the TinyMCE toolbar doesn’t show by default on Astra theme and Page Builder Framework theme. It does show on some default WP themes, but I don’t understand why.

    In Astra, the toolbar is there in the HTML, but it has display: none set to the CSS because of this class string: .no-js .hide-if-no-js

    I don’t quite understand what is causing that class to be added onto the toolbar. Can anyone shed some light? Is there some option or filter I need to set for this to show?

    I at first thought it detected if there was No JS enabled in the browser but thats not the issue because I can use JS…im visiting my test forum just as Im visiting this one and it shows.

    #240621
    Uriahs Victor
    Participant

    This is an old topic but the priority on the filters have changed so the remove filter code provided will not work.

    The new priority is 40, so the working code is:

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 40 );	
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 40 );
    #240600
    teresaanderson
    Participant

    I just checked. It doesn’t look like I have the code from the previous posts anywhere on the site. I checked all of the custom CSS screens.

    #240599
    Robin W
    Moderator

    so quick question – do you have any of the code above active – it should not be, as my plugin should work in its place

    #240597
    adunbound
    Participant

    Hi, I’m haviong trouble with bbpress and the forum breaking my footer. I’m utilizing the shortcode to input the forum, when I delete the shortcode, the footer realigns. Does anyone know what causes this and how to fix it?

Viewing 25 results - 126 through 150 (of 32,334 total)
Skip to toolbar