Search Results for 'code'
-
AuthorSearch Results
-
February 28, 2016 at 1:38 pm #172319
In reply to: Yet another sidebar issue
Robin W
Moderatorok, sorry been tied up elsewhere, and only just got back to looking at this.
I think I can get it working and would suggest you do the following
1. take a copy of page.php and save it into your theme as bbpress.php
so you end up with
wp-content/themes/%mytheme%/bbpress.php where %mytheme% is your currently active theme’s name.
Now edit that file as follows
The theme seems to be looking for a value of the sidebar for the post meta of the page ID. Since I suspect that bbpress is not having that at that point, it can’t look it up.
Now the page.php (which is now bbpress.php!) tries to set this in line 4 using
$sidebar = get_post_meta($id, "qode_show-sidebar", true);and then the page.php (which is now bbpress.php!) later on looks for what value between 1 and 4 that is set to, which would determine what if any sidebars are shown.
therefore in bbpress.php try changing line 4 from
$sidebar = 1
save the file and see what happens
then try
$sidebar = 2
$sidebar = 3
$sidebar = 4each should change what sidebar appears and where, so you should be able to get one working !
Do come back if anything isn’t clear, or if you need further help, or just to tell us that we’re wonderful (or rubbish!)
February 28, 2016 at 11:55 am #172316Topic: add a specific class
in forum Themesneecride
ParticipantHello,
I look for how to add a class css on loop-single-forum.php line 12
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>on default
bbp_forum_class();sorry I’m french ! I do not understand English too
February 28, 2016 at 10:22 am #172315Pascal Casier
ModeratorHi siparker,
I won’t start about your first line about the ‘money’, but for adding new functionalities of finding code for existing tickets, https://bbpress.trac.wordpress.org is one of the places that can be used for that. If a ticket is there and there is code attached, it makes a fair chance to be added into future versions.
Pascal.
February 28, 2016 at 10:16 am #172314In reply to: Changing Author ID on submit
Pascal Casier
ModeratorHi,
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_commentBut this is for comments, not for replies …
Pascal.
February 28, 2016 at 9:22 am #172313Robkk
ModeratorWell 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\defaultTo 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/
February 28, 2016 at 8:10 am #172311In reply to: Importing from phpbb3 to bbpress
abiliocaetano
ParticipantI 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,
February 27, 2016 at 7:11 pm #172307In reply to: phpbb to bbpress converter and best practice?
abiliocaetano
ParticipantHi 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,
February 27, 2016 at 6:40 am #172285In reply to: Anyway to auto-populate a forum structure?
Stephen Edgar
KeymasterYou can also use the built in export WordPress WXR (which is just an XML file), and WordPress Importer plugin.
February 26, 2016 at 9:30 pm #172276In reply to: Yet another sidebar issue
Robkk
ModeratorYour 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 clearfixYou may need to contact your theme author for further help on this.
February 26, 2016 at 8:26 pm #172274In reply to: Yet another sidebar issue
dgalfano
ParticipantSure! 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.)
February 26, 2016 at 8:06 pm #172272In reply to: BBPress not working with Optimizepress Theme
Robin W
ModeratorAs 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
February 26, 2016 at 7:30 pm #172265In reply to: best rated forum post display
Robkk
ModeratorYou 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']February 26, 2016 at 7:01 pm #172263In reply to: Yet another sidebar issue
Robin W
Moderatorok, can you paste the page.php file here please AND make sure you enclose it all as code !
February 26, 2016 at 5:52 pm #172260In reply to: BBPress not working with Optimizepress Theme
Robin W
Moderatorok, 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?February 26, 2016 at 5:08 pm #172256Topic: Yet another sidebar issue
in forum Troubleshootingdgalfano
ParticipantYes, 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.
February 26, 2016 at 4:51 pm #172253thinkDrew
ParticipantThanks 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+friesperam.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.
February 26, 2016 at 4:05 pm #172248In reply to: New topic area on forum not showing up
Robkk
ModeratorThis 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; }February 26, 2016 at 2:37 pm #172244In reply to: bbp_new_forum hook
fterra
ParticipantHi, 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 tobbp_forum_attributes_metabox_saveaction, whose argument is $forum_id.
Hope it helps.February 26, 2016 at 1:49 pm #172240In reply to: BBPress not working with Optimizepress Theme
Robkk
ModeratorSee 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.
February 26, 2016 at 12:11 pm #172232_az_
ParticipantI 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… 🙂
February 26, 2016 at 5:49 am #172226erlendglommen
ParticipantHi,
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
ErlendFebruary 26, 2016 at 5:06 am #172225In reply to: What do I do?
Robin W
Moderatorall 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.
February 25, 2016 at 5:52 pm #172222In reply to: bbp-form style
mulaps
Participanthttp://codepen.io/anon/pen/XdrBJq?editors=0100#0
The main.cssFebruary 25, 2016 at 8:08 am #172204Topic: bbp-form style
in forum Themesmulaps
ParticipantHi.
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-forumsection image: http://imgur.com/2cGasYv
Can someone please help me with this problem? I zoomed out page to create image.February 25, 2016 at 6:24 am #172201blux78
ParticipantHi 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
-
AuthorSearch Results