Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,826 through 6,850 (of 32,505 total)
  • Author
    Search Results
  • #172314
    Pascal Casier
    Moderator

    Hi,
    If this is the standard wordpress function (never used this function before), then you cannot have a ‘post_author_id’, should be ‘user_ID’ and the ‘post_author’ should be ‘comment_author’ …
    See https://codex.wordpress.org/Plugin_API/Filter_Reference/preprocess_comment

    But this is for comments, not for replies …

    Pascal.

    Robkk
    Moderator

    Well you cannot modify the functions in the template.php by copying over the file like the file in the bbPress default theme, which is in wp-content\plugins\bbpress\templates\default

    To customize the code in template.php you would have to filter the code. Paste any new functions you create with the filters from the template.php file into a functions.php file in your child theme or in a custom functionality plugin.

    https://codex.wordpress.org/Function_Reference/add_filter

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

    #172311
    abiliocaetano
    Participant

    I used cms2cms to migrate one of my forums.

    in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.

    if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.

    to do this you just have to:

    Open/edit:

    /styles/prosilver/template/overall_header.html
    (or the template you are using)

    search for:

    // Send vars to template
    $template->assign_vars(array(
    ‘FORUM_ID’ => $forum_id,

    and just above this lines add this piece of code:

    ##################################
    $titleac = trim($topic_data[‘topic_title’]);
    $relativeurl = str_replace(‘ ‘,’-‘,$titleac);
    $relativeurl = strtolower($relativeurl);
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
    #####################################

    I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/

    regards,

    #172307
    abiliocaetano
    Participant

    Hi all,

    in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.

    if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.

    to do this you just have to:

    Open/edit:
    /styles/prosilver/template/overall_header.html
    (or the template you are using)

    search for:

    // Send vars to template
    $template->assign_vars(array(
    ‘FORUM_ID’ => $forum_id,

    and just above this lines add this piece of code:

    ##################################
    $titleac = trim($topic_data[‘topic_title’]);
    $relativeurl = str_replace(‘ ‘,’-‘,$titulo);
    $relativeurl = strtolower($relativeurl);
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
    #####################################

    I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/

    regards,

    #172285
    Stephen Edgar
    Keymaster

    You can also use the built in export WordPress WXR (which is just an XML file), and WordPress Importer plugin.

    #172276
    Robkk
    Moderator

    Your theme looks to be using post meta to display the sidebars, so there might be custom fields to configure which sidebar to display which will most likely be on the default WordPress post types (page and post) when you create/edit them. These options may not be on the bbPress post type creation/editing screens in the WordPress backend.

    I see there is a ton of code that might not even be usable because bbPress post types may not have these custom field options to configure things like the slider, background color, and other options I can see in the code.

    I do see from the classes that this uses a responsive grid layout so maybe focus and keep this class as it is a two column layout, one for the content and one for the sidebar.

    two_columns_66_33 grid2 clearfix

    You may need to contact your theme author for further help on this.

    #172274
    dgalfano
    Participant

    Sure! Thanks for looking!

    https://gist.github.com/anonymous/34d96600379e037b60ae

    (mod note: when people search the forums, they hate scrolling through giant pieces of code. Small snippets use code tags, large files use external services to host the code.)

    #172272
    Robin W
    Moderator

    As far as I can see the solution is with that code snippet – it fits the problem description very well

    can you amend line

    if ($forumPage->post_type == 'forum'){
    
    

    to

    if ($forumPage->post_type == bbp_get_forum_post_type() ){
    

    and try it again

    #172265
    Robkk
    Moderator

    You can install a plugin like WP Ulike and use that for rating posts.

    Then you can create a custom bbPress view using this function. Add this php code snippet into your child themes functions.php file or in a plugin that can hold custom code snippets like the functionality plugin.

    function rkk_register_custom_view() {
     	bbp_register_view( 'top-rated-topics', __( 'Top Rated Topics' ),  array( 'meta_key' => '_topicliked', 'orderby' => 'meta_value_num' , 'post_status' => 'publish' ), false );
     }
     add_action( 'bbp_register_views', 'rkk_register_custom_view' );

    Then paste this shortcode in a page called Top Rated Topics.

    [bbp-single-view id='top-rated-topics']

    #172263
    Robin W
    Moderator

    ok, can you paste the page.php file here please AND make sure you enclose it all as code !

    #172260
    Robin W
    Moderator

    ok, just eliminating as sometimes local (pc) installations can have url issues.

    Can you tell us in

    Dashboard>settings>forums

    what the forums root is set to and also do yiu bave a wordpress page with [bbp-forum-index] on it? and if what is the url of that page?

    #172256
    dgalfano
    Participant

    Yes, I’ve searched and came across numerous similar problems about the sidebar not displaying on the forum pages. Yes, I read through the canned responses to review this page: https://codex.bbpress.org/themes/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/.

    We’re using the Bridge theme and I’ve made sure the forums page is using the page.php template, AND the <?php get_sidebar();?> IS in the code. So why is the forum index showing full-width and not showing my bbPress sidebar?

    Looking at source code of the rendered page does not show the sidebar though.

    http://tinyurl.com/hwak4zg

    thinkDrew
    Participant

    Thanks for the reply!

    This is actually something I did before posting here (should have mentioned it) and while running the default 2015 theme, I am running into the same issue. This is the URL /forums/search/french+fries/ that is returning in the browser instead of the normal /?s=french+fries peram.

    It’s strange as I have several other corporate wordpress sites running (not w/ bbpress) but have never had a problem with “out of the box” search widgets :)…

    I will continue to test (only running 4 plugins) and see what comes from that.

    #172248
    Robkk
    Moderator

    This is the CSS causing the issue. This is found in a custom css plugin or a custom stylesheet from your theme.

    #bbpress-forums fieldset.bbp-form p, 
    #bbpress-forums fieldset.bbp-form textarea, 
    #bbpress-forums fieldset.bbp-form select, 
    #bbpress-forums fieldset.bbp-form input, 
    #bbpress-forums fieldset.bbp-form .buddyboss-select {
        display: none;
    }
    #172244

    In reply to: bbp_new_forum hook

    fterra
    Participant

    Hi, antipole,
    I’m trying to do the same, subscribe all users to new forums and to new topics also.
    I’ve been working on it for a while, mainly figuring out how bbPress itself works.
    In the case you want to run something when someone creates a new forum from the admin page, my bet is you will want to hook to bbp_forum_attributes_metabox_save action, whose argument is $forum_id.
    Hope it helps.

    #172240
    Robkk
    Moderator

    See if this plugin fixes the issue you might be experiencing.

    https://github.com/OptimizePress/op-bbpress-fix

    The plugin seems to only contain a really small code snippet in it, so if you want to instead paste this code snippet instead you can also try that.

    Add this function to your child themes (if you have a child theme) functions.php file, or add the php code snippet into a plugin that can hold custom php code snippets like the functionality plugin.

    function op_allow_bbforum() {
        $forumPage = get_post(url_to_postid( "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] ));
        if ($forumPage->post_type == 'forum'){
            op_update_option('blog_enabled','Y');
            op_update_option('installed','Y');
        }
    }
    add_action('init', 'op_allow_bbforum');

    Make sure to test and see if this plugin/code snippet works for all of bbPress’ post types.

    _az_
    Participant

    I think #2258 is pretty complex to implement but possible. Might take some days to do it i guess.

    Here is my workaround:

    in functions.php:

    /**
     * for nicer permalinks:
     * 
     * from: forums/forum/name -> to forum/name
     * 
     * also required rewrite rules below in myThemeName_addRewriteRules
     */
    function myThemeName_bbp_get_forum_permalink_withoutRootSlug() {
    	return preg_replace( '/(' . bbp_get_root_slug() . '\/)/', '', bbp_get_forum_permalink()); 
    }
    
    function myThemeName_addRewriteRules() {
    	/**
    	 * add rewrite rules for bbpress
    	 */
    	
    	// use this to test instead of clicking Save Changes in Settings -> Permalinks
    	// global $wp_rewrite;
    	// $wp_rewrite->flush_rules();
    
    	add_rewrite_endpoint(get_option('_bbp_forum_slug'), EP_ROOT);
    	add_rewrite_rule('^'. get_option('_bbp_forum_slug') . '/(.*)?','index.php?post_type=forum&name=$matches[1]');
    }
    add_action('init', 'myThemeName_addRewriteRules');

    Replacement in my custom loop-single-forum.php:
    <a href="<?php echo myThemeName_bbp_get_forum_permalink_withoutRootSlug(); ?>">

    Default bbpress templates use it at more places than my theme:

    Found 5 matches of bbp_(get_)?forum_permalink in 4 files.	
    loop-search-forum.php	
    		<a href="<?php bbp_forum_permalink(); ?>" class="bbp-forum-permalink">#<?php bbp_forum_id(); ?></a>      [position 18:18]	
    		<h3><?php _e( 'Forum: ', 'bbpress' ); ?><a href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a></h3>      [position 26:58]	
    loop-search-topic.php	
    			<a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a>      [position 41:19]	
    loop-single-forum.php	
    		<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>      [position 32:42]	
    loop-single-topic.php	
    				<span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>      [position 68:102]	

    Feel free to hit the Flattr Button on my page: az.zankapfel.org

    Update: Seems that the breadcrumbs need a hack too… 🙂

    erlendglommen
    Participant

    Hi,

    How can I create a similar sidebar as is shown in the bbPress Support page (this page)? I really like the forum list (which I know I can create with the standard widget), but I can’t find how to create the extra #Posts column that displays the number of posts within each forum.

    And how do you add the pin icons in the “Views” sidebar?

    Within each forum there is also a really nice “Forum info” sidebar with #-of-topics, #-of-replies, last-post-by etc. Are these created with shortcode within a text-widget? And there are nice icons displayed here as well.

    It all looks really nice and clean and I would like to replicate it.

    All the best
    Erlend

    #172225

    In reply to: What do I do?

    Robin W
    Moderator

    all themes allow a child theme – it is a wordpress thing not a theme thing. They won’t ‘support’ as in give you free help to set up and run.

    see

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    As Pascal says, we can help with specific queries, but not in a full set-up. But googling around will fix a lot of what you’re asking.

    #172222

    In reply to: bbp-form style

    mulaps
    Participant

    http://codepen.io/anon/pen/XdrBJq?editors=0100#0
    The main.css

    #172204

    Topic: bbp-form style

    in forum Themes
    mulaps
    Participant

    Hi.
    Im using motoblog theme from wolfthemes. After installing bbPress forum plugin i had issue with content wrapper. In the custom css section added fief lines:

    #bbpress-forums {
        width: 92%;
        max-width: 1140px;
        margin: 0 auto 30px;    
    
    }

    But i still have the problem with bbp-forum section image: http://imgur.com/2cGasYv
    Can someone please help me with this problem? I zoomed out page to create image.

    #172201
    blux78
    Participant

    Hi everyone,

    I’m trying to accomplish the exact same thing hoborob was doing here above.

    Does anyone have a clear answer on this one, where to put what code in which file? Have searched the web extensively and found several solutions which come close, but not quite right yet.

    Thanks in advance for your time and help!

    Kind regards, blux78

    #172195
    Pascal Casier
    Moderator

    Hi,
    Just want to add that, for the people that do not want to code this, the functionality is also in the ‘bbP Toolkit’ plugin.
    Pascal.

    #172192

    In reply to: What do I do?

    Pascal Casier
    Moderator

    Hi John,
    We are all very much eager to help each other, but this forum runs on volunteers so we cannot just help you setting up your forum completely for you. You can however find people that do this for a living and pay them.

    Reading your above description I’m hesitating between ‘where is the question?’ and ‘There are 20 questions in 1 topic here’. So if you have any specific question, feel free to ask and if we can respond, we will.

    Trying to answer some parts and giving thoughts:
    – Not support child themes ? Then switch theme !
    – You can always put extra code in the functions.php of you theme, but after a theme upgrade make sure to check your updates are still there
    – For the login/redirect you are already on 2/3 other threads in this forum, please try to not repeat yourself in here

    So, for any specific question… shoot !

    Pascal.

    #172190
    Pascal Casier
    Moderator

    Hi,
    If you are on the /wp-admin/users.php page, you can select one or more users and then use the dropdown box on top that says ‘Change forum role to…’ and hit the ‘Change’ button next to it.

    If you edit a specific user on /wp-admin/user-edit.php?user_id=1234 you should find a ‘Forums’ section and a dropdown where you can set the forum role.

    Of course you can never change it on your OWN profile.

    Pascal.

Viewing 25 results - 6,826 through 6,850 (of 32,505 total)
Skip to toolbar