Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,476 through 5,500 (of 32,518 total)
  • Author
    Search Results
  • #181772
    dropshot
    Participant

    @JohnJamesJacoby

    The problem is if you create a page with the same slug as your forum index and insert the forum index shortcode, this page will just be a page that happens to contain bbpress content. It isn’t a real bbpress page.

    If you would like your index page (mysite.com) as your forum index how can you make that a real forum page? NOT just a page that contains bbpress content.

    You can’t set your forum root index to nothing cause this will make default value (forums) to reappear. Of course you can 301 redirect /forums to index page. But as mentioned, this will display a page with forum content. NOT a real forum page.

    Appreciate any kind of suggestions.

    #181766
    jpvanmuijen
    Participant

    Hi, this topic has been very helpful in getting the latest replies, thanks Barry & Robin!
    I’m trying to get the topic of the last five replies and later on construct the URL using the topic URL and reply # (kinda like Robin’s shortcode plugin does), but I can’t figure out how to do this.
    I changed $author_id = get_post( $single_item[‘id’] )->post_author to $topic_id = get_post( $single_item[‘id’] )->topic hoping it would return the topic ID, but no luck. Is there a way to retrieve how to target this field?
    Thanks again!

    #181755
    phil49
    Participant

    Hello Robin,

    Thanks for the reply again.

    I pasted the code in the additional Custom CSS section in WordPress, indeed I immediately noticed that page width was wider by about 1/5.

    However, the “bbpress.php” template was… not affected ! 🙁

    I tried copying the code in the style.css in the child theme previously created, but same thing no wide page again !

    As I noticed since the beginning, ALL the site pages, I mean the one managed by this epoymous section in WordPress ARE affected by any additional CSS code, BUT NO page in the forum section with the “bbpress.page” Template are concerned by any modification !

    It’s as if so long as there’s no modification on the bbpress.php code or it’s CSS, nothing could happen !

    Yet, as mentioned earlier, in the child theme I’ve created, I added as explained in this forum : http://www.designbombs.com/master-twenty-seventeen-wordpress-theme/ , the following files :

    1 style.css file
    1 page-full-width.php
    1 function.php

    Was there any other operation I should have done ?

    For instance, should I try something with the Bbpress-style-pack I’ve installed a few weeks ago for another purpose but that includes a CSS section ?

    I don’t really understand what I’m supposed to do, the explanation is not quite clear to me !

    It’s explained that it will create a “bspstyle.css” file but what will be the impact on the whole site as I just want to alter page width ONLY on the forum pages, the other pages have the adequate width !

    Kind regards,

    Philippe

    #181748
    Robin W
    Moderator

    ok, put this in the custom css

    .single-post:not(.has-sidebar) #primary, 
    .page.page-one-column:not(.twentyseventeen-front-page) #primary, 
    .archive.page-one-column:not(.has-sidebar) .page-header,
     .archive.page-one-column:not(.has-sidebar) #primary {
      max-width: 100% !important;
    }
    

    you may need to play with it if it affects other parts of your site.

    if you don’t know how to do this – come back

    #181703
    Fuskeduske
    Participant

    Hi RotiSoft,

    You can change bbp_get_forum_last_reply_title to bbp_get_forum_last_topic_title, to get rid of the reply-to tag. However this will still make problems, while for example deleting or trashing a topic.

    Robin gave me the following code, it should show the latest title without “reply-to” tag: http://pastebin.com/raw/jY5hSPPp

    This should be used together with:

    <?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    <?php bbp_forum_freshness_link(); ?>
    <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>

    However you might need to adjust a little due to the way of your theme setup.

    -Fuske

    #181699
    Tamas Rottenbacher
    Participant

    Hi @fuskeren!

    I don’t use bbPress style pack plugin.
    The theme use that code for call the last active topic display:
    <a rel="internal" href="<?php bbp_forum_last_reply_url(); ?>" title="Legutóbbi aktív téma: <?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a>
    and under that: (the second line, the time and user)

    <?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    <?php bbp_forum_freshness_link(); ?>
    <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>

    I’m tried add that code:

        <?php
        	$forum_id  = bbp_get_forum_id( $forum_id );
    		$active_id = bbp_get_forum_last_active_id( $forum_id );
    	?>
        <?php echo bbp_get_forum_last_reply_url( $forum_id ); ?><br />
    	<?php echo bbp_get_forum_last_reply_title( $forum_id ); ?>

    But that add “Comment:” or “Reply:” because that is the reply title, not the last active topic.

    #181668
    Fuskeduske
    Participant

    Hi Crew,

    I have just tried running the code on my own test invironment, and i can see, that the code, does not seems to work.

    I do however not have enough knowhow to help you further.

    I am glad to see, that you got your functions file to work atleast.

    #181658
    Fuskeduske
    Participant

    Hi Crewockeez,

    1. Line of Robins code appears to be broken, can you try replacing it with:

    add_filter ('bbp_filter_anonymous_post_data' , 'rew_filter_anonymous_post_data' 10, 2);

    #181648
    Fuskeduske
    Participant

    Hi RotiSoft,

    Could you provide me with a description of how you’re displaying the titles?

    I’ve just recently had a longer correspondence with RobW, about what i think is the same issue.

    He told me as follows:

    Basically a category holds the last active ID of its sub forums, and each sub forum also holds its last active ID. But deleting a sub forum topic seems to get the category last active ID wrong.

    I see that he just updated he’s bbpress style pack plugin, with a hotfix for this issue,
    while he gave me the snippet of the code used for the fix, it does not work if your tweak is done if you’re using code as in this: https://bbpress.org/forums/topic/freshness-link/

    I don’t think Robin would mind me sharing the code snippet, as he implemented it in he’s free plugin, but as requested i would like to know how you’re displaying it.

    -Fuske

    #181647
    Robin W
    Moderator

    lots of shortcodes available for putting into pages and posts

    Shortcodes

    and I have additional shortcodes in my style pack plugin

    https://wordpress.org/plugins/bbp-style-pack/

    #181637
    crewockeez
    Participant

    i try insert new code. not work.

    #181623
    Robin W
    Moderator

    this – it has some parts changed !!

    add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
    
    function rew_filter_anonymous_post_data( $retval, $r  ) {
    	// Filter variables and add errors if necessary
    	$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name',  $r['bbp_anonymous_name']  );
    	if ( empty( $r['bbp_anonymous_name'] ) )
    		bbp_add_error( 'bbp_anonymous_name',  __( '<strong>ERROR</strong>: Invalid author name submitted!',   'bbpress' ) );
    
    	// Website is optional
    	$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
    
    	// Return false if we have any errors
    	$retval = bbp_has_errors() ? false : $r;
    
    	// Finally, return sanitized data or false
    	return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r );
    }
    #181613
    crewockeez
    Participant

    i insert code on functions.php on my team

    add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
    
    function rew_filter_anonymous_post_data( $retval, $r  ) {
    	// Filter variables and add errors if necessary
    	$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name',  $r['bbp_anonymous_name']  );
    	if ( empty( $r['bbp_anonymous_name'] ) )
    		bbp_add_error( 'bbp_anonymous_name',  __( '<strong>ERROR</strong>: Invalid author name submitted!',   'bbpress' ) );
    
    	// Website is optional
    	$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
    
    	// Return false if we have any errors
    	$retval = bbp_has_errors() ? false : $r;
    
    	// Finally, return sanitized data or false
    	return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );

    upload file functions.php on server. open site error.

    #181612
    Robin W
    Moderator

    not sure what you mean, but corrected code here

    add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
    
    function rew_filter_anonymous_post_data( $retval, $r  ) {
    	// Filter variables and add errors if necessary
    	$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name',  $r['bbp_anonymous_name']  );
    	if ( empty( $r['bbp_anonymous_name'] ) )
    		bbp_add_error( 'bbp_anonymous_name',  __( '<strong>ERROR</strong>: Invalid author name submitted!',   'bbpress' ) );
    
    	// Website is optional
    	$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
    
    	// Return false if we have any errors
    	$retval = bbp_has_errors() ? false : $r;
    
    	// Finally, return sanitized data or false
    	return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r );
    }
    #181603
    crewockeez
    Participant

    no insert code on fuctions file. on site error

    add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
    
    function rew_filter_anonymous_post_data( $retval, $r  ) {
    	// Filter variables and add errors if necessary
    	$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name',  $r['bbp_anonymous_name']  );
    	if ( empty( $r['bbp_anonymous_name'] ) )
    		bbp_add_error( 'bbp_anonymous_name',  __( '<strong>ERROR</strong>: Invalid author name submitted!',   'bbpress' ) );
    
    	// Website is optional
    	$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
    
    	// Return false if we have any errors
    	$retval = bbp_has_errors() ? false : $r;
    
    	// Finally, return sanitized data or false
    	return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );
    }
    #181598
    Robin W
    Moderator

    untested, but try adding this to your functions file

    add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
    
    function rew_filter_anonymous_post_data( $retval, $r  ) {
    	// Filter variables and add errors if necessary
    	$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name',  $r['bbp_anonymous_name']  );
    	if ( empty( $r['bbp_anonymous_name'] ) )
    		bbp_add_error( 'bbp_anonymous_name',  __( '<strong>ERROR</strong>: Invalid author name submitted!',   'bbpress' ) );
    
    	// Website is optional
    	$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
    
    	// Return false if we have any errors
    	$retval = bbp_has_errors() ? false : $r;
    
    	// Finally, return sanitized data or false
    	return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );
    }
    #181591
    Robin W
    Moderator

    This is in a file called form-anonymous.php :

    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

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-anonymous.php
    bbPress will now use this template instead of the original
    and you can amend this

    you will see that lines 26-29 contain

    <p>
    			<label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br />
    			<input type="text" id="bbp_anonymous_email"   value="<?php bbp_author_email(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" />
    		</p>

    Just delete this and save, and this field will not be shown

    #181501
    phil49
    Participant

    Hi,

    Just a question: how can I know which page model is being used by the forum pages ?

    Is there a way to know it through the dashboard or inspecting the source code ?

    Regards

    Philippe

    #181492
    Robin W
    Moderator

    have you been through no. 8 in this link

    Step by step guide to setting up a bbPress forum – Part 1

    Md Sadiqur Rahman
    Participant

    bbp additional shortcodes plugin solved the problem 🙂

    Md Sadiqur Rahman
    Participant

    Hi,
    I’m using [bbp-single-forum id=#] shortcode to show forum under a certain category. Above it, there is a status bar (counts topics and replies). It is not fitting with my homepage. Is there a way to delete it?

    Screenshot:https://www.dropbox.com/s/52kip18610x7iu7/forum-1.png?dl=0

    #181486
    Stiofan
    Participant

    i had to do this today for a few hours, only hidden with CSS and message displayed but might help someone:

    // put forum in read only mode
    add_action('bbp_theme_after_reply_form','gd_bbp_read_only_mode');
    add_action('bbp_theme_after_topic_form','gd_bbp_read_only_mode');
    function gd_bbp_read_only_mode(){
    
    	?>
    <style>
    	fieldset.bbp-form{ display: none;}
    </style>
    	<div style="background: red;color: white;"><h2>The forum is currently in read only mode while we perform some maintenance, this should only take a few hours.</h2></div>
    <?php
    }
    phil49
    Participant

    Hi

    I’ve been reading many posts on this forum and tried out many proposed solutions but to no avail up to now 🙁

    I first started with the copy of an unmodified and renamed in “bbpress.php” “page.php” file at the root of my theme folder, then with another one with a slight modification of the code substituting the class “content-area”with “content-area-wide”, I then tried another method creating a subfolder in my theme and copying the above mentioned file as well as a modified “style.css” file.
    The code was simply :
    .content-area-wide {
    float: left; margin-right: -100%; width: 100%}


    @import
    url (“../twentyseventeen/style.css”);

    Unless the code is not correct or the path or it’s syntax either, of course it didn’t work either.

    Surprisingly, the page listing all the forums is using almost the full width, and looks exactly what I’m looking for anyway but as son as I get in one of the forums they are displayed as if on one column way and aligned on the left.
    Same thing for the abovementioned page if I go back to it unless I refresh it…
    I should point out that I don’t use or have any sidebar for these pages and I’m not concerned by this kind of problem like many other people!
    As I’m not a master of the code, could anybody help me and describe each step to solve this frustrating issue so that I can follow each step and not guess intermediate steps considered as obvious are easy by the most learned guys !?

    Thanks so much for our site subscribers

    Regards,

    Philippe

    #181464
    Robin W
    Moderator
    #181446
    en10
    Participant

    OK, I found the code who make this issue.

    function SearchFilter($query) {
        if ( $query->is_search && !is_woocommerce() && !is_admin()) {
            $query->set( 'post_type', 'post,page' );
        }
        if ( function_exists( 'is_woocommerce' ) ) : 
            if ( $query->is_search && is_woocommerce() && !is_admin()) {
                $query->set( 'post_type', 'product' );
            }
        endif;
        return $query;
     }
    add_filter('pre_get_posts','SearchFilter');

    I put this function in functions.php because without that I can’t search on my blog AND Woocommerce with the plugin Releanssi).

    But what the problem with this function?

    EDIT: I found a topic and the fix of @robin-w

    Topics not appearing in forum

    I will try this fix very soon.

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