Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,776 through 3,800 (of 32,517 total)
  • Author
    Search Results
  • Robin W
    Moderator

    use

    Code Snippets

    and enter any code there

    #199626
    likipadhy
    Participant

    Okay, so what I want is show the topic creation date in freshness column. I understand that I need to edit the template files but what code ll be going to that column, and how we’ll get the date?
    suppose the topic is created on March 24th, 2019 I want to show this date on freshness column.

    #199623

    In reply to: Designing site

    Robin W
    Moderator
    aaron77
    Participant

    Hi all,

    I hope this is the right place to put this but I need some help. A quick backstory I’m working for a startup and before I joined someone made the site for them on WordPress. He left however and I’ve taken over the general running of the site, I have a decent understanding of WordPress because I have messed around with it before but this is the biggest project I’ve been apart of.

    On to the problem they want to add a news section with news from the industry (blockchain). So I’m trying to research how to get that done and most of the plugins I’ve found keep talking about entering a snippet of code into your site to do X or Y. The problem is that the person before me built the site using some plugin I have never seen before.

    Any help would be greatly appreciated.

    #199580
    jaykaybee
    Participant

    I would like to use html in topics that is then reflected in excerpts. There is a plug-in for general WP called Advanced Excerpt that enables this. But I am wondering if it can be done for bbpress excerpts.

    Details:

    In a forum (https://devgo.jeffbelkora.com/collections/articles/resource-list/) I am using some code from https://premium.wpmudev.org/forums/topic/bbpress-topic-excerpts, namely:

    function add_topic_excerpt() {
    echo “<p>”.bbp_get_topic_excerpt( $topic_id, 200).”</p>”;
    }
    add_action(‘bbp_theme_after_topic_title’, ‘add_topic_excerpt’ );

    Unfortunately, the bbpress excerpt does not show active links (html) from the content as I desire.

    Any ideas?

    #199563

    In reply to: size of menu font

    Robin W
    Moderator
    span.bbp-admin-links a {
    	font-size: 24px !important;
    }
    #199556

    In reply to: Lager font

    Robin W
    Moderator

    put this in your custom css

    #bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-replies, #bbpress-forums ul.bbp-search-results {
    	font-size: 24px !important;
    }
    #199490
    Robin W
    Moderator

    I think this may do it – but I’ve no knowledge of mathml, other than a quick google

    This code is untested, but add this to your child theme function file or use the ‘code snippets’ plugin

    add_filter( 'bbp_kses_allowed_tags', 'rew_add_mathml') ;
    
    function rew_add_mathml ($allowed) {
    	$allowed['math'] = array() ;
    	$allowed['mo'] = array() ;
    	$allowed['mi'] = array() ;
    
    return $allowed ;
    }

    you would need to add lines for other tags required.

    #199476
    Robin W
    Moderator

    change this to

    /*
    // Forum topic count (Stored in postmeta)
    $this->field_map[] = array(
    ‘from_tablename’ => ‘forums_table’,
    ‘from_fieldname’ => ‘the_topic_count’,
    ‘to_type’ => ‘forum’,
    ‘to_fieldname’ => ‘_bbp_topic_count’
    );
    */
    licondam
    Participant

    Hi there!

    We’re trying to move our forums from a custom Q&A platform to bbPress… very glad there is now an importer!

    So I copied example.php to myimport.php, changed the class name, and updated the tables/columns that apply (the ones that exist in the old database).

    And ran the import…

    But I keep running into import errors for fields that don’t apply as they don’t exist in the other database, like forums_table.the_reply_count

    So for a field that just does not exist in the old database, what’s the proper syntax for “ignore this”? 🙂

    For example, this one…

    // Forum topic count (Stored in postmeta)
    $this->field_map[] = array(
    ‘from_tablename’ => ‘forums_table’,
    ‘from_fieldname’ => ‘the_topic_count’,
    ‘to_type’ => ‘forum’,
    ‘to_fieldname’ => ‘_bbp_topic_count’
    );
    I looked for this on the importer codex page, but just don’t see it.

    Thanks!
    LICON

    #199473
    Hummingbird
    Participant

    Unfortunately it didn’t work :(. It’s just weird that it’s just this one page and the other topic pages are fine…like you said, the difference seems to be that for the page in question (linked above with the centering issue), it is a short-code pasted on an actual page of my website, whereas the rest are bbpress generated.

    Interesting to note, I had to use the ubiquitous twenty seventeen theme for the forum pages (include the one we are trying to fix) because the theme for my website was so incompatible with buddypress. It ran bbpress fine. In fact, this centering thing was not a problem for my theme (but I had to switch since the theme would not allow buddypress). It was only once I set the twenty seventeen theme to this page specifically that this issue appeared! Not sure if that helps with any more solutions…

    #199472
    Robin W
    Moderator

    so from forums loop remove

    <li class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></li>
    

    and from loop single forum remove

    <li class="bbp-forum-freshness">
    
    		<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    
    		<?php bbp_forum_freshness_link(); ?>
    
    		<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
    
    		<p class="bbp-topic-meta">
    
    			<?php do_action( 'bbp_theme_before_topic_author' ); ?>
    
    			<span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
    
    			<?php do_action( 'bbp_theme_after_topic_author' ); ?>
    
    		</p>
    	</li>

    I’ll let you work out the topics

    #199470
    Robin W
    Moderator

    try

    .archive:not(.page-one-column):not(.has-sidebar) #primary article {
     float : none !important;
     Width : 100% !important ;
    
    }
    #199469
    Hummingbird
    Participant

    I pasted in the code you sent as is, and it did not center the page :(. Any other thoughts on how I could approach this issue?

    #199451
    Hummingbird
    Participant

    Wordpress version:5.1.1
    bbPress version: 2.5.14

    Question #1:

    Here’s the page I’m looking at: http://www.toledonaturalist.org/forums/

    I cannot figure out how to center the forum information on the page. I created this “forums” page and simply pasted in this shortcode: [bbp-forum-index]

    At first I thought there was an invisible sidebar. Nope, it does not appear that there are any active sidebars. Perhaps I could fiddle around with the template? Nope, doesn’t seem to impact anything. I could try centering the shortcode with CSS? Nope, this didn’t work either, although I don’t know much about CSS, so I easily could have just typed it in wrong.

    The weird thing is that all of the children pages are centered. It’s just this page that is having issues.

    Question #2)
    Here is the page I am looking at:
    http://www.toledonaturalist.org/login/?redirect_to=http%3A%2F%2Fwww.toledonaturalist.org%2F

    This is so bizarre! The login works great, but I don’t even have a login page on my list of “pages.” I want to change the header image and the redirection after login, but I have no idea where bbpress is getting this page. Without knowing where it is, I cannot reset the redirection after login (I want it to go to the very first link in this post) or change the header image.

    Let me know what you think!

    #199450
    jemar707
    Participant

    Hi Robin! Thanks for the reply.

    This is what I am using to reorder replies:

    // Reverse forum replies order from newer to older
     
    function custom_bbp_has_replies() {
    $args['order'] = 'DESC'; // ‘ASC’ (Ascending, Default), 'DESC' (Descending)
     
    return $args;
    }
     
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
     
    function custom_bbp_show_lead_topic( $show_lead ) {
    $show_lead[] = 'true';
    return $show_lead;
    }
     
    add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
    #199435
    Techknowledgic
    Participant

    Hey, I was using BBpress before but now I decided to stop using it because I was getting a lot of spam posts and users and I don’t have the time to keep on tracking the forums.

    However, after deleting the bbpress plugin, I see an inflated wp_posts and wp_postmeta databases each one around 700mb and I found out here that bbpress store their data in wp_posts and wp_postmeta

    Stored Database Data

    So I am wondering, how can I delete the bbpress related databases from the wp_posts and wp_postmeta without affecting my other posts or pages I have created?

    I have 3 more websites with even more posts created by me, but without bbpress and the wp_posts and wp_postsmeta is like 20mb or so. That’s why I am sure that the inflated databse are because of bbpress.

    So anyone can help me figure out how to delete the bbpress related databases?

    #199421
    lorcannolan
    Participant

    I’m having a weird “bug” or just unwanted result from something that usually works perfectly.

    (0,0) removed via usual method:

    function remove_counts() {
        $args['show_topic_count'] = false;
        $args['show_reply_count'] = false;
        $args['count_sep'] = '';
    return $args;
    }
    add_filter('bbp_before_list_forums_parse_args', 'remove_counts' );

    Unfortunately this time it is leaving me with the commas still intact despite the separator being target to be removed (I’m not comfortable with coding like most of you guys but years in WordPress you have to pick up a few things).

    Probably easier if you take a look at this point it’s : MCR Biker Community Forum

    I am using a plugin called Youzer to style the forum if that has any effect. Switching themes doesn’t fix.

    Any suggestions?

    #199417
    lucju04
    Participant

    Hi everybody,

    I would like to creat a home for my forum who loop some forum in blocs. And in this bloc I would like to list sub forum with topic count, post count and freshness.

    I make a mockup to be more precise ^^ You can the here: https://ibb.co/zFD60d1

    I already try to make these loop but I can’t retrieve the freshness & counts for each sub forum.

    And also I need to design differently each row but bbpress retrieve data in columns…

    Do you already make something like this ?

    I found this function:

    //This function adds descriptions to the sub forums
    function custom_list_forums( $args = '' ) {
    
    	// Define used variables
    	$output = $sub_forums = $topic_count = $reply_count = $counts = '';
    	$i = 0;
    	$count = array();
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => ' <span class="counts">[ ',
    		'count_after'       => '  réponse(s) ]</span>',
    		'count_sep'         => ' sujet(s), ',
    		'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );
    
    	// Loop through forums and create a list
    	$sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    	if ( !empty( $sub_forums ) ) {
    
    		// Total count (for separator)
    		$total_subs = count( $sub_forums );
    		foreach ( $sub_forums as $sub_forum ) {
    			$i++; // Separator count
    
    			// Get forum details
    			$count     = array();
    			$show_sep  = $total_subs > $i ? $r['separator'] : '';
    			$permalink = bbp_get_forum_permalink( $sub_forum->ID );
    			$title     = bbp_get_forum_title( $sub_forum->ID );
    			$content = bbp_get_forum_content($sub_forum->ID) ;
    
    			// Show topic count
    			if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
    			}
    
    			// Show reply count
    				$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
    
    			// Counts to show
    			if ( !empty( $count ) ) {
    				$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    			}
    
    			// Build this sub forums link
    			$output .= $r['before'].$r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'].'<div class="bbp-forum-content">'.$content.'</div>'.$r['after'];
    		}
    
    		// Output the list
    		return $output ;
    	}
    }
    
    add_filter('bbp_list_forums', 'custom_list_forums' );

    I got the description of subforum, it’s a good start..

    #199356
    tunyafix
    Participant

    Hi! when we move topic to other forum the subscribed user forum don’t receive the notification.
    Because the action only is performed on new topics
    add_action( 'bbp_new_topic', 'bbp_notify_forum_subscribers', 11, 4 );

    We created on function bbp_move_topic_handler

    
        $topic_author = bbp_get_topic_author_id( $topic_id );
        $anonymous_data = 0;
    
        do_action( 'bbp_move_topic', $topic_id, $new_forum_id, $anonymous_data, $topic_author );
    

    and also added

    
    add_action( 'bbp_move_topic',    'bbp_notify_forum_subscribers',           11, 4 );
    

    But we think it should be part of core
    Best regards

    #199334
    chezsheles
    Participant

    oops – I mean the code in my child theme functions. Just so it’s clear. I’m using a child theme and have added the code to the child theme functions.

    #199333
    chezsheles
    Participant

    Hi – The solution offered by robkk creates a white screen (o’ death) on the front end and then this error in the debug_log:

    [18-Mar-2019 17:13:21 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in .../wp-content/themes/MyStupidTheme/functions.php on line 63

    Line 63 in my child functions file is the first line of code:

    <?php if ( !bbp_is_single_forum() ) : ?>

    I used php code checker to see whether or not the code was still valid, and it checked out ok.

    I even cut and pasted the code from this page to Text Wrangler, to strip it of any errant styling or whatnot before I pasted it into my child theme. Still get the same error and white screen.

    What else might I try?

    Thanks much for any help!

    #199331
    badrobot
    Participant

    Thanks. I have done that. I guess what I am looking for is some bbPress specific code that I can add to the style sheet in the child theme. There are a number of examples that come up in searches but none have worked in this theme. This particular theme allows for an override of the side bar setting on a page by page basis. There must be some bbPress specific code that could be placed in the child theme style sheet to extend that override to bbPress forum pages.

    #199326
    Robin W
    Moderator

    ok, for the participants trashing topics, install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topic/Reply Display items 17,18,& 19

    On the widgets, install
    the ‘widget logic plugin’, and on pages you want the widget, use

    is_bbpress()

    in the condition

    #199324
    lucju04
    Participant

    I think this task will be hard for you. Anybody around you can help you with basic knowloedge of CSS and PHP/WordPress ?

    You have a explaination of many custom things you can do with bbpress here : https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/

    GOod luck 😉

Viewing 25 results - 3,776 through 3,800 (of 32,517 total)
Skip to toolbar