Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,001 through 3,025 (of 32,453 total)
  • Author
    Search Results
  • #209358
    Robin W
    Moderator

    just tried it, it is all good, you must have missed a character off somewhere, just add it to the end

    <?php
    function hello_elementor_child_enqueue_scripts() {
    wp_enqueue_style(
    'hello-elementor-child',
    get_stylesheet_directory_uri() . '/style.css',
    [
    'hello-elementor'
    ],
    '1.0.0'
    );
    }
    add_action( 'wp_enqueue_scripts', 'hello_elementor_child_enqueue_scripts' );
    function ele_disable_page_title( $return ) {
    return false;
    }
    add_filter( 'hello_elementor_page_title', 'ele_disable_page_title' );
    add_filter( 'bbp_register_topic_post_type', 'rew') ;
    
    function rew ($rew) {
    
    $rew = array(
    				'labels'              => bbp_get_topic_post_type_labels(),
    				'rewrite'             => bbp_get_topic_post_type_rewrite(),
    				'supports'            => bbp_get_topic_post_type_supports(),
    				'description'         => esc_html__( 'bbPress Topics', 'bbpress' ),
    				'capabilities'        => bbp_get_topic_caps(),
    				'capability_type'     => array( 'topic', 'topics' ),
    				'menu_position'       => 555555,
    				'has_archive'         => ( 'forums' === bbp_show_on_root() ) ? bbp_get_topic_archive_slug() : false,
    				'exclude_from_search' => true,
    				'show_in_nav_menus'   => true,
    				'public'              => true,
    				'show_ui'             => current_user_can( 'bbp_topics_admin' ),
    				'can_export'          => true,
    				'hierarchical'        => false,
    				'query_var'           => true,
    				'menu_icon'           => '',
    				'source'              => 'bbpress',
    			)  ;
    			
    return $rew ;
    }
    
    add_filter( 'bbp_register_reply_post_type', 'rew2') ;
    
    function rew2 ($rew) {
    
    $rew2 = array(
    				'labels'              => bbp_get_reply_post_type_labels(),
    				'rewrite'             => bbp_get_reply_post_type_rewrite(),
    				'supports'            => bbp_get_reply_post_type_supports(),
    				'description'         => esc_html__( 'bbPress Replies', 'bbpress' ),
    				'capabilities'        => bbp_get_reply_caps(),
    				'capability_type'     => array( 'reply', 'replies' ),
    				'menu_position'       => 555555,
    				'exclude_from_search' => true,
    				'has_archive'         => false,
    				'show_in_nav_menus'   => true,
    				'public'              => true,
    				'show_ui'             => current_user_can( 'bbp_replies_admin' ),
    				'can_export'          => true,
    				'hierarchical'        => false,
    				'query_var'           => true,
    				'menu_icon'           => '',
    				'source'              => 'bbpress',
    			)  ;
    			
    return $rew2 ;
    }
    #209350

    In reply to: Split up my Tags page

    webcreations907
    Participant

    I created that example, I just used the categories on your page for the example since the buttons are built based of of those.

    I didn’t do really any styling to it since it’s just a example.

    Link Below
    https://codepen.io/WebCreations907/full/zYGWLRe

    If you like that way that works and want to add it to your site, let me know and can get you some steps on getting that added to your page.

    🙂

    #209335

    In reply to: Freshness is way off

    webcreations907
    Participant

    No problem, glad that’s working out for you so far. 🙂

    You can remove the code when bbpress releases a fix for it, it’s just a temporary solution until it gets worked out.

    #209332

    In reply to: Freshness is way off

    ericsims
    Participant

    Alright, I pasted it in to functions.php, and it seems to be working so far. Thanks so much for sharing! I’ll keep an eye on it over the coming days and hope it keeps working.

    Will I need to remove this code if/when bbPress is updated to incorporate this fix?

    #209304

    In reply to: Freshness is way off

    webcreations907
    Participant

    The below should update the “Topic” page and the main “Forum” page.

    Once you add the code, you’ll have to add a reply to a topic for it to update. Or run the forum repair Robin W mentioned above.

    Add the below code to your functions.php file of your theme (preferably child theme), or use the code snippet plugin.

    
    if(!function_exists('ticket3297_bbpress_update_latest_activity')){
    	function ticket3297_bbpress_update_latest_activity( $reply_id, $topic_id, $forum_id ){
    		
    		$new_time = get_post_field( 'post_date', $reply_id );
    		
    		if ( ! empty( $new_time ) ) {
    			update_post_meta( $forum_id, '_bbp_last_active_time', $new_time );
    		}
    		update_post_meta( $forum_id, '_bbp_last_active_id', $reply_id);
    		update_post_meta( $forum_id, '_bbp_last_reply_id', $reply_id );
    
    		$forum_obj = get_post( $forum_id );
    		if( $forum_obj && $forum_obj->post_parent !== 0 && bbp_is_forum_category( $forum_obj->post_parent ) ){
    		
    			update_post_meta( $forum_obj->post_parent, '_bbp_last_active_id', $reply_id );
    			update_post_meta( $forum_obj->post_parent, '_bbp_last_reply_id', $reply_id );
    			if ( ! empty( $new_time ) ) {
    				update_post_meta( $forum_obj->post_parent, '_bbp_last_active_time', $new_time );
    			}
    		}
    
    	}
    	add_action( 'bbp_new_reply', 'ticket3297_bbpress_update_latest_activity',10,3 );
    }
    
    if(!function_exists('ticket3297_bbpress_delete_update_latest_activity')){
    	function ticket3297_bbpress_delete_update_latest_activity(){
    			$reply_id = bbp_forum_query_last_reply_id();
    			
    			ticket3297_bbpress_update_latest_activity( $reply_id, bbp_get_reply_topic_id( $reply_id ), bbp_get_reply_forum_id( $reply_id ) );
    
    	}
    	add_action('bbp_deleted_reply','ticket3297_bbpress_delete_update_latest_activity');
    	add_action('bbp_trashed_reply','ticket3297_bbpress_delete_update_latest_activity');
    }
    
    

    That should run when replying, deleting, and trashing replies.

    #209301

    In reply to: @mentions

    Robin W
    Moderator

    maybe, I’m tied up in paid work at the moment, so can’t really find time to take a look at the code

    #209270

    Topic: Split up my Tags page

    in forum Themes
    Clivesmith
    Participant

    I have a page that just shows tags https://wateratairports.com/airports-by-iata-code/, it is working great and getting bigger over 300 it could grow to 1000 which is OK on a big screen but on a mobile, not good, I would like to add a line at the top of the tags offering a shortcut ie if you want A-F click this then it will take the user to a page that shows tags stating A and ending with F.

    I am sure I can create the line with links to another page, where I am having a problem is how to only return the tags between A and F.

    The template I am using is

    /**
    * Template Name: bbPress – Topic Tags
    *
    * @package bbPress
    * @subpackage Theme
    */

    get_header(); ?>

    <?php do_action( ‘bbp_before_main_content’ ); ?>

    <?php do_action( ‘bbp_template_notices’ ); ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <div id=”bbp-topic-tags” class=”bbp-topic-tags”>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    <div class=”entry-content”>

    <?php get_the_content() ? the_content() : _e( ‘<p>This is a collection of tags that are currently popular on our forums.</p>’, ‘bbpress’ ); ?>

    <div id=”bbpress-forums”>

    <?php bbp_breadcrumb(); ?>

    <div id=”bbp-topic-hot-tags”>

    <?php wp_tag_cloud( array( ‘smallest’ => 15, ‘largest’ => 15, ‘number’ => 400, ‘taxonomy’ => bbp_get_topic_tag_tax_id() ) ); ?>

    </div>
    </div>
    </div>
    </div><!– #bbp-topic-tags –>

    <?php endwhile; ?>

    <?php do_action( ‘bbp_after_main_content’ ); ?>

    Is there a way to select what tags are shown ?, I am happy to create more templates.
    hope this makes snese

    #209261
    nabeelpommy
    Participant

    Hello! I am using bbpress and when I type anything in topic and try to apply formatting like bold, italic text, it show the code instead of applied formatting, suppose I applied B for bold it shows <b> Text</b> and does not make text bold , same like other command , like if I try to make text as heading3 its shows <H3> Text </H3> instead of text in Heading 3 style.
    What is problem , thx in advance

    Regards
    Like I use b tag here and my text has bold , but in my case it show command name alognwith text instead of applying that command

    #209238
    Barry
    Participant

    Gotcha!

    Well (and I’m admittedly writing this without ever having worked with GamiPress, but I did just take a quick peek at their code) it certainly seems like something you could do.

    The gamipress_award_points_to_user action (a hook that your code can ‘listen’ for) would let you detect the award of points and you could then examine how many points they have etc and, based on that, take a further step such as changing their forum permissions.

    Definitely seems achievable 🙂

    #209237
    Robin W
    Moderator

    forums etc. are not for the dashboard part of the site for participants.

    create a page and put this code in it

    [bbp-forum-index]

    Then put this page into your site menu

    #209202

    In reply to: Topic Title length

    Chuckie
    Participant

    I suggest you install the plugin Snippets:

    Code Snippets

    Then you can create a snippet and put it there.

    #209201

    In reply to: Topic Title length

    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    #209200

    In reply to: Topic Title length

    nek123
    Participant

    Hi, I have the same issue… where do I add this code? Please help, I’m not a web expert 🙂

    #209198
    samtime
    Participant

    Hi,
    Is there a shortcode to display just sticky topics?
    I tried the code below, but it shows both sticky and non sticky topics.

    [bsp-display-topic-index show = '5' show_stickies = 'true']

    Thank you, Sam

    #209196

    In reply to: Reddit style forum

    webcreations907
    Participant

    Hello,

    Easiest way would be to override the bbpress’s content-single-topic.php file and move bbp_get_template_part( 'form', 'reply' ); to above bbp_get_template_part( 'loop', 'replies' ); within that file.

    For another option, I’ve tried the below on a few different themes without any issues. You’d add the below code to your theme’s functions.php file. Best if you add to child theme so that you don’t have to re-add if you update your theme, same would apply for the first option above.

    
    
    if ( !function_exists( 'oscowordpress1_move_bbpress_reply_form_filter' ) ) {
    	function oscowordpress1_move_bbpress_reply_form_filter( $template , $slug , $name ) {
    
    		if ( is_array( $template ) && in_array( 'form-reply.php', $template ) ) {
    			remove_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10 );
    			return array();
    		}
    
    		return $template;
    	}
    }
    
    if ( !function_exists('oscowordpress1_move_bbpress_reply_form')){
    	function oscowordpress1_move_bbpress_reply_form( $slug, $name ){
    
    		if ( isset( $name ) && $name == 'replies' ) {
    			bbp_get_template_part( 'form', 'reply' );
    			add_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10, 3 );
    		}
    	}
    	add_action( 'get_template_part_loop', 'oscowordpress1_move_bbpress_reply_form', 10 ,2 );
    }
    
    

    Best of luck, and hope one of those work out for you. 🙂

    #209195
    Barry
    Participant

    I have zero knowledge of GamiPress…but let’s park that part of the question for a moment 🙂

    Like WordPress itself, bbPress supplies a plethora of hooks that will let you write code that listens for various events—such a new topics being created or replies being added—at which point your code can scan for keywords and interact in various ways. I’m not sure exactly what you’re picturing, but having the bot add replies of its own or perhaps even trigger currency transfers in the context of GamiPress are all possibilities.

    How easy this would be I guess really depends on what sort of tasks you want your bot to perform and what conditions you wish to be met before it performs them, but certainly bbPress/WordPress by themselves provide a nice foundation to build on top of.

    #209191
    webcreations907
    Participant

    The topics & replies within forums you can change in your WordPress admin area at Settings > Forums below “Topics and Replies Per Page”.

    If you want to change the displayed forum amount(shortcode you mentioned), try adding the below code to your functions.php file of your WordPress theme.

    
    if(!function_exists('poco06_bbpress_change_forum_count_display')){
    	function poco06_bbpress_change_forum_count_display( $args ){
    		if( is_array( $args ) && array_key_exists( 'post_type', $args ) && $args['post_type'] == 'forum'){
    			$args['posts_per_page'] = 100; //Change to number of displayed you want
    		}
    		return $args;
    	}
    
    	add_filter( 'bbp_after_has_forums_parse_args', 'poco06_bbpress_change_forum_count_display' ,10 );
    }
    

    That should increase it to 100, change as needed. There might be a plugin for that as well that others may be able to point you to.

    🙂

    #209190
    webcreations907
    Participant

    You could add the below CSS to get your forums off your header and make the forums fill the page width.

    You’d want to add the code to style.css file, preferably in a child theme so that when you update you don’t have to re-add the code. Or if that theme has a options panel with a area to add custom CSS.

    
    body.bbpress .content-wrapper .content-area {
        max-width: none;
        padding: 0 7px;
    }
    
    body.bbpress .content-wrapper, 
    body.bbpress.no-sidebar.page .content-wrapper {
        margin: 0;
        padding: 0;
    
    }
    
    body.bbpress .site-content {
        padding: 30px 0;
    }
    

    Just thought I’d throw that out there as a option 🙂

    #209178
    manish198530
    Participant

    hello

    i am using bb-press plugin in my theme
    i have to add short code in my page with word-press function like this in .php page
    “<?php echo do_shortcode(‘[bbp-forum-index]‘); ?>”

    it’s not working on .php page
    —————————————
    but when i create page in wordpress admin section and add shortcode on page it’s working

    but on .php page it’s not working
    can you please help me what i am doing wrong

    Thanks 🙂

    #209177
    poco06
    Participant

    Hello,

    I’m using bbpress with the DIVI theme and got an issue : the [bbp-forum-index] shortcode returns only 50 forums end no more !
    I have also tried with the Twenty Twenty theme and got the same issue.

    Any idea how I could display more than 50 forums with this shortcode?

    Wordpress 5.3.2 and bbpress 2.6.4
    Regards
    Pat

    #209171
    Robin W
    Moderator

    ok, I’d suggest you take the breadcrumb out as well – that’s the

    Home › Forums › Community

    So put this in your theme’s custom css area

    div.bbp-breadcrumb {
    	display: none !important;
    }
    #209146
    Robin W
    Moderator

    your theme has a css rule

    .content-wrapper.with-featured-image {
    	margin: -4.7em 0 0 120px;
    	padding: 1.3em 55px 0 1.9em;
    }

    Basically the ‘margin: -4.7em’ bit is causing the forum to show at a minus height, thus crashing into the header.

    the forums page (https://badasscrafters.com/forums/) has the rule without-featured-image so is fine.

    Do you have a ‘forums’ page – ie you have a page in your site which has the shortcode

    [bbp-forum-index]

    #209060
    ocglimited
    Participant

    I am succesfully using bbpress, with the Avada theme. I notice that my bbpress pages have strange title (in the browser tab). FOr example:

    https://telium.io/search/code/

    How can I fix this?

    #209048
    iamthewebb
    Participant

    I’ve just been testing this on my sites and I can’t get it to fail. Are there any more details in the server error log, do you have any custom code or bbpress plugins installed?
    Also does debugging show any additional info?

    #209011
    Chuckie
    Participant

    Would you mind showing your code and an example? Sounds great!

Viewing 25 results - 3,001 through 3,025 (of 32,453 total)
Skip to toolbar