Search Results for 'code'
-
AuthorSearch Results
-
August 31, 2015 at 6:13 pm #166110
In reply to: Member Names are shortened
Robkk
ModeratorThis is CSS from your theme that is causing the issue.
.x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-name, .x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-role, .x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-ip { display: block; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }Using this Custom CSS could fix your issue. Place the custom CSS where you can put CSS code snippets like a custom CSS plugin, some option in your theme, etc. Add
!importantif it still does not work..x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-name, .x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-role, .x-bbp-item-info-content .x-bbp-item-info-author .bbp-author-ip { overflow: visible; text-overflow: inherit; white-space: inherit; }August 31, 2015 at 5:20 pm #166105In reply to: MyBB 1.8 to bbpress
erich199
ParticipantHere is the fix I worked out to get the importer to work properly.
The problem I was having was the user accounts were not being imported due to some outdated usermeta fields in the database. I simply removed the sql code from the current importer script, re-ran, and it worked correctly.
I wanted to share the code of that mybb import script. The file name is Mybb.php.
<?php /** * Implementation of MyBB Forum converter. * * @since bbPress (r5140) * @link Codex Docs https://codex.bbpress.org/import-forums/mybb */ class MyBB extends BBP_Converter_Base { /** * Main Constructor * * @uses MyBB::setup_globals() */ function __construct() { parent::__construct(); $this->setup_globals(); } /** * Sets up the field mappings */ public function setup_globals() { /** Forum Section *****************************************************/ // Forum id (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'fid', 'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_id' ); // Forum parent id (If no parent, then 0, Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'pid', 'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_parent_id' ); // Forum topic count (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'threads', 'to_type' => 'forum', 'to_fieldname' => '_bbp_topic_count' ); // Forum reply count (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'posts', 'to_type' => 'forum', 'to_fieldname' => '_bbp_reply_count' ); // Forum title. $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'name', 'to_type' => 'forum', 'to_fieldname' => 'post_title' ); // Forum slug (Clean name to avoid conflicts) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'name', 'to_type' => 'forum', 'to_fieldname' => 'post_name', 'callback_method' => 'callback_slug' ); // Forum description. $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'description', 'to_type' => 'forum', 'to_fieldname' => 'post_content', 'callback_method' => 'callback_null' ); // Forum display order (Starts from 1) $this->field_map[] = array( 'from_tablename' => 'forums', 'from_fieldname' => 'disporder', 'to_type' => 'forum', 'to_fieldname' => 'menu_order' ); // Forum dates. $this->field_map[] = array( 'to_type' => 'forum', 'to_fieldname' => 'post_date', 'default' => date('Y-m-d H:i:s') ); $this->field_map[] = array( 'to_type' => 'forum', 'to_fieldname' => 'post_date_gmt', 'default' => date('Y-m-d H:i:s') ); $this->field_map[] = array( 'to_type' => 'forum', 'to_fieldname' => 'post_modified', 'default' => date('Y-m-d H:i:s') ); $this->field_map[] = array( 'to_type' => 'forum', 'to_fieldname' => 'post_modified_gmt', 'default' => date('Y-m-d H:i:s') ); /** Topic Section *****************************************************/ // Topic id (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'tid', 'to_type' => 'topic', 'to_fieldname' => '_bbp_topic_id' ); // Topic reply count (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'replies', 'to_type' => 'topic', 'to_fieldname' => '_bbp_reply_count', 'callback_method' => 'callback_topic_reply_count' ); // Topic total reply count (Includes unpublished replies, Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'replies', 'to_type' => 'topic', 'to_fieldname' => '_bbp_total_reply_count', 'callback_method' => 'callback_topic_reply_count' ); // Topic parent forum id (If no parent, then 0. Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'fid', 'to_type' => 'topic', 'to_fieldname' => '_bbp_forum_id', 'callback_method' => 'callback_forumid' ); // Topic author. $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'uid', 'to_type' => 'topic', 'to_fieldname' => 'post_author', 'callback_method' => 'callback_userid' ); // Topic Author ip (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'ipaddress', 'join_tablename' => 'threads', 'join_type' => 'INNER', 'join_expression' => 'USING (tid) WHERE replyto = 0', 'to_type' => 'topic', 'to_fieldname' => '_bbp_author_ip' ); // Topic content. // Note: We join the 'posts' table because 'threads' table does not have content. $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'message', 'join_tablename' => 'threads', 'join_type' => 'INNER', 'join_expression' => 'USING (tid) WHERE replyto = 0', 'to_type' => 'topic', 'to_fieldname' => 'post_content', 'callback_method' => 'callback_html' ); // Topic title. $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'subject', 'to_type' => 'topic', 'to_fieldname' => 'post_title' ); // Topic slug (Clean name to avoid conflicts) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'subject', 'to_type' => 'topic', 'to_fieldname' => 'post_name', 'callback_method' => 'callback_slug' ); // Topic parent forum id (If no parent, then 0) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'fid', 'to_type' => 'topic', 'to_fieldname' => 'post_parent', 'callback_method' => 'callback_forumid' ); // Sticky status (Stored in postmeta)) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'sticky', 'to_type' => 'topic', 'to_fieldname' => '_bbp_old_sticky_status', 'callback_method' => 'callback_sticky_status' ); // Topic dates. $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'dateline', 'to_type' => 'topic', 'to_fieldname' => 'post_date', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'dateline', 'to_type' => 'topic', 'to_fieldname' => 'post_date_gmt', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'lastpost', 'to_type' => 'topic', 'to_fieldname' => 'post_modified', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'lastpost', 'to_type' => 'topic', 'to_fieldname' => 'post_modified_gmt', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'lastpost', 'to_type' => 'topic', 'to_fieldname' => '_bbp_last_active_time', 'callback_method' => 'callback_datetime' ); // Topic status (Open or Closed, MyBB v1.6.10 open = null & closed = 1) $this->field_map[] = array( 'from_tablename' => 'threads', 'from_fieldname' => 'closed', 'to_type' => 'topic', 'to_fieldname' => 'post_status', 'callback_method' => 'callback_topic_status' ); /** Tags Section ******************************************************/ /** * MyBB v1.6.10 Forums do not support topic tags out of the box */ /** Reply Section *****************************************************/ // Reply id (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'pid', 'from_expression' => 'WHERE replyto != 0', 'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id' ); // Reply parent forum id (If no parent, then 0. Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'fid', 'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id', 'callback_method' => 'callback_topicid_to_forumid' ); // Reply parent topic id (If no parent, then 0. Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'tid', 'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id', 'callback_method' => 'callback_topicid' ); // Reply author ip (Stored in postmeta) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'ipaddress', 'to_type' => 'reply', 'to_fieldname' => '_bbp_author_ip' ); // Reply author. $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'uid', 'to_type' => 'reply', 'to_fieldname' => 'post_author', 'callback_method' => 'callback_userid' ); // Reply title. $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'subject', 'to_type' => 'reply', 'to_fieldname' => 'post_title' ); // Reply slug (Clean name to avoid conflicts) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'subject', 'to_type' => 'reply', 'to_fieldname' => 'post_name', 'callback_method' => 'callback_slug' ); // Reply content. $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'message', 'to_type' => 'reply', 'to_fieldname' => 'post_content', 'callback_method' => 'callback_html' ); // Reply parent topic id (If no parent, then 0) $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'tid', 'to_type' => 'reply', 'to_fieldname' => 'post_parent', 'callback_method' => 'callback_topicid' ); // Reply dates. $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'dateline', 'to_type' => 'reply', 'to_fieldname' => 'post_date', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'dateline', 'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'edittime', 'to_type' => 'reply', 'to_fieldname' => 'post_modified', 'callback_method' => 'callback_datetime' ); $this->field_map[] = array( 'from_tablename' => 'posts', 'from_fieldname' => 'edittime', 'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt', 'callback_method' => 'callback_datetime' ); /** User Section ******************************************************/ // Store old User id (Stored in usermeta) $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'uid', 'to_type' => 'user', 'to_fieldname' => '_bbp_user_id' ); // Store old User password (Stored in usermeta serialized with salt) $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'password', 'to_type' => 'user', 'to_fieldname' => '_bbp_password', 'callback_method' => 'callback_savepass' ); // Store old User Salt (This is only used for the SELECT row info for the above password save) $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'salt', 'to_type' => 'user', 'to_fieldname' => '' ); // User password verify class (Stored in usermeta for verifying password) $this->field_map[] = array( 'to_type' => 'users', 'to_fieldname' => '_bbp_class', 'default' => 'MyBB' ); // User name. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'username', 'to_type' => 'user', 'to_fieldname' => 'user_login' ); // User nice name. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'username', 'to_type' => 'user', 'to_fieldname' => 'user_nicename' ); // User email. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'email', 'to_type' => 'user', 'to_fieldname' => 'user_email' ); // User homepage. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'website', 'to_type' => 'user', 'to_fieldname' => 'user_url' ); // User registered. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'regdate', 'to_type' => 'user', 'to_fieldname' => 'user_registered', 'callback_method' => 'callback_datetime' ); // User display name. $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'usertitle', 'to_type' => 'user', 'to_fieldname' => 'display_name' ); // Store Signature (Stored in usermeta) $this->field_map[] = array( 'from_tablename' => 'users', 'from_fieldname' => 'signature', 'to_type' => 'user', 'to_fieldname' => '_bbp_mybb_user_sig', 'callback_method' => 'callback_html' ); } /** * This method allows us to indicates what is or is not converted for each * converter. */ public function info() { return ''; } /** * This method is to save the salt and password together. That * way when we authenticate it we can get it out of the database * as one value. Array values are auto sanitized by WordPress. */ public function callback_savepass( $field, $row ) { $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); return $pass_array; } /** * This method is to take the pass out of the database and compare * to a pass the user has typed in. */ public function authenticate_pass( $password, $serialized_pass ) { $pass_array = unserialize( $serialized_pass ); return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); } /** * Translate the post status from MyBB v1.6.10 numeric's to WordPress's strings. * * @param int $status MyBB v1.6.10 numeric topic status * @return string WordPress safe */ public function callback_topic_status( $status = 0 ) { switch ( $status ) { case 1 : $status = 'closed'; break; case 0 : default : $status = 'publish'; break; } return $status; } /** * Translate the topic sticky status type from MyBB v1.6.10 numeric's to WordPress's strings. * * @param int $status MyBB v1.6.10 numeric forum type * @return string WordPress safe */ public function callback_sticky_status( $status = 0 ) { switch ( $status ) { case 1 : $status = 'sticky'; // MyBB Sticky 'topic_sticky = 1' break; case 0 : default : $status = 'normal'; // MyBB Normal Topic 'topic_sticky = 0' break; } return $status; } /** * Verify the topic/reply count. * * @param int $count MyBB v1.6.10 topic/reply counts * @return string WordPress safe */ public function callback_topic_reply_count( $count = 1 ) { $count = absint( (int) $count - 1 ); return $count; } }Hope this helps someone else who is switching over from MyBB to WordPress.
August 31, 2015 at 4:13 pm #166101Topic: Freshness on Forum Index not updating
in forum Troubleshootinggptxffa
ParticipantI wanted to forums to show New topics on top and the forum index below so I did the following as instructed by Robkk:
Go to Settings > Forums and change the forum root to show Topics by Freshness.
Then add this function to your child themes functions.php or into a functionality plugin.
function recent_bbpress_topics() {
echo do_shortcode(“[bbp-forum-index]“);
}add_action(‘bbp_template_after_topics_index’,’recent_bbpress_topics’);
Now I have noticed that the Forum Index which is below the most recent topics does not display the proper time and date in the “freshness” column.
Any thoughts?
August 31, 2015 at 4:09 pm #166100Topic: Profile pictures are TINY
in forum TroubleshootingLexiconLuthor
Participanthttp://northfloridafishkeepers.com/forums-2
as you can see the pictures next to people’s names are microscopic. Please tell me there is a simple css code that will fix this
August 31, 2015 at 4:16 am #166082Topic: Moving topics doesn’t update the forum-page
in forum TroubleshootingDenna Gherlyn
ParticipantHello,
I’ve a caching(?) problem and I’ve no idea how to solve it.
I use bbpress on a single website in a multisite wordpress installation with the
[bbp-forum-index]bbcode on a custom page as front page.
Now I realised that then I’m moving topics or deleting some of them the topic- and post-counter as the freshness column doesn’t update. There still seems to be a topic but then clicking on the forum there isn’t.
My first suspect is the cache but after smashing the F5 button and manually clearing the browser cache it’s still there. Also topics deleted a long time ago are still in the freshness column but not in the topic- and post-counter.
We’re not using any caching plugins. The only thing that comes near a caching plugin is the plugin wordfence that has a caching option, but that function is disabled. I also deactivated the plugin but nothing changed.Now I’m quite confused. Does someone know of any problems with following plugins?
What I’ve tried:
– deactivating wordfence
– use the Twenty Fifteen theme instead of evolve (on a test page same result if I move topics between different main categories or parent forums)What I use:
– WordPress 4.3
– bbPress 2.5.8
– evolve theme 3.4.3 with a child theme
on http://hackish.codes/hcforum/
test website: http://hackish.codes/testpage/These plugins are active together with bbpress (on both the test website and the productive forum):
– Breadcrumb NavXT 5.2.2
– Redux Framework 3.5.7
– Wordfence Security 6.0.15
– WPML Multilingual CMS 3.2.6 (active on multisite but deactivated through the WPML intern deactivation)
– WP Statistics 9.5.3
– BuddyPress 2.3.3
– WP Hide Admin Bar 2.0
– Orbisius Child Theme Creator 1.2.8August 30, 2015 at 10:21 pm #166071In reply to: Only Keymaster can see the forums
Robkk
ModeratorDid you try flushing your permalinks and possilbly checking if it is a plugin issue?
Also check if the users role is in fact have participant forum role.
August 30, 2015 at 9:50 pm #166065In reply to: Deactive the Open Graph option in Yoast SEO
Robkk
ModeratorI looked in the source code and I see no Open Graph tags on your bbPress pages, and it all seems to be working fine to me.
August 30, 2015 at 2:48 pm #166045In reply to: BBpress Forum Search not Working with theme
Robkk
ModeratorTry this.
Create a child theme if you haven’t already, and copy the bbPress template files into your child theme.
This guide will tell you what folders containing files you can copy over into your theme.
August 30, 2015 at 2:38 pm #166041In reply to: Sort topics alphabetically
August 29, 2015 at 9:44 pm #166032Topic: MyBB 1.8 to bbpress
in forum Troubleshootingerich199
ParticipantHi,
I’ve tried to use the forum converter and it does import the board, but it isn’t importing users. Is there something special I need to to to get the user account migrated over?It’s giving me this error
WordPress database error: [Unknown column 'users.msn' in 'field list']Thanks for the help.
August 29, 2015 at 1:38 pm #166023In reply to: Replies cutting off
karl.lundgren
ParticipantThe bbpress plugin has 4 css files. I’ve inserted that css code into all 4 and the problem remains.
August 29, 2015 at 1:14 pm #166022In reply to: Add/Change User roles
Robkk
Moderatorit would work like this though
#bbpress-forums .community .bbp-author-role { background-color: blue; }or
#bbpress-forums .team .bbp-author-role { background-color: yellow; }August 29, 2015 at 12:36 pm #166020In reply to: Deactive the Open Graph option in Yoast SEO
Robkk
ModeratorI just tested on my test site, and I do not really see an issue with the OG tags. Maybe there is something else. You may need to try some troubleshooting.
August 29, 2015 at 3:51 am #166013In reply to: Add/Change User roles
sbskamey
ParticipantAhh, that’s brilliant. It works! Thanks so much! You’re a god!
My last question is about changing the background colours. I’m using your code:
function rk_show_role_classes($classes) { $replyid = bbp_get_reply_author_id(); $bbp_get_role = bbp_get_user_display_role($replyid); $bbp_display_role = strtolower($bbp_get_role); $classes[] = $bbp_display_role; return $classes; } add_filter( 'bbp_get_topic_class','rk_show_role_classes' ); add_filter( 'bbp_get_reply_class','rk_show_role_classes' );and added in some css, like you said:
.communitymember .bbp-author-role { background-color: blue; }This may seem like a basic question, but am I suppose to amend your code in any way? If so, I have tried multiple variations of it (logic guess work), and a few variations of css, with no luck.
Please could you guide me as to what I need to change on your code to get it to work?
Thanks again,
KamAugust 29, 2015 at 12:47 am #166011In reply to: Forum won’t load in Safari
Robkk
ModeratorTry some troubleshooting first if you haven’t already, check your cache(this includes browser cache if the main browser you use is safari).
August 29, 2015 at 12:45 am #166010In reply to: Replies cutting off
Robkk
Moderator#bbpress-forums .reply { margin-left: 0 !important; width: auto !important; }August 28, 2015 at 10:34 pm #166004For Games
ParticipantHello, everybody, this is my resolution:
first, i have my own plugin, named ‘sc64’. then add these php code to my plugin.add_filter('bbp_get_do_not_reply_address','scap_bbp_no_reply_email'); function scap_bbp_no_reply_email(){ $admin_email = get_option('admin_email'); return $admin_email; }the default noreply email address has changed to admin_email that configured in wordpress.
i hope this helps.
August 28, 2015 at 9:07 pm #166000In reply to: Add/Change User roles
Robkk
Moderatorat the very end of this function
function custom_capabilities( $role )You see this
); break; default : return $role; }Well your missing a
}at the very end.the end of the function should look like this.
); break; default : return $role; } }August 28, 2015 at 8:36 pm #165999Topic: Freshness incorrect on edited post
in forum Troubleshootinggeog272
ParticipantHi there, when editing a post, I choose the “log this edit” checkbox. After editing, I get something like the following listed beneath the topic text:
This topic was modified 1 month, 3 weeks ago by lxxx@gmail.com.
This topic was modified 29 seconds ago by lxxx@gmail.com.However, the “freshness” is still listed as the first (older) time and therefore the sort order in the recent topics shortcode page doesn’t change — so a recently edited post doesn’t float to the top of the list. Is there anything I can do to fix this?
Thanks!
August 28, 2015 at 8:23 pm #165998In reply to: Deactive the Open Graph option in Yoast SEO
Robkk
ModeratorWell thing is having meta tags shouldn’t really affect bbPress at all. And I was figuring it may be how something is configured in their plugin that is causing issues.
<meta property="og:title" content="The Rock" /> <meta property="og:type" content="video.movie" /> <meta property="og:url" content="http://www.imdb.com/title/tt0117500/" /> <meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />Or are you saying that the meta tags do not work on bbPress forums, but the bbPress forums work fine??
August 28, 2015 at 4:11 pm #165982Topic: Contact form – native or plugin?
in forum PluginsBrovashift
ParticipantHi, still setting things up here…
I was just wondering if there was a shortcode or something to add a contact for to my forum?
My site just has a contact page already created, with the text: [contact-form-7 id=”4″ title=”Contact Form”]. But I don’t see that plugin installed.
I would prefer to add a contact form / widget natively if possible. If not, is contact form 7 plugin the way to go?
Thanks guys!
August 28, 2015 at 8:08 am #165975Mei Ling
ParticipantIf your theme gets a breadcrumb, then disable Yoast’s one. You may have two breadcrumb:
First ==> WordPress
Second==> BBPressYou do this:
*/ function tempera_breadcrumbs1() { $temperas= tempera_get_theme_options(); foreach ($temperas as $key => $value) { ${"$key"} = $value ; } global $post; $separator = "<i class='icon-angle-right'></i> "; if( !is_bbpress()){ if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) { echo '<div class="breadcrumbs">'; echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a>'.$separator ; if (is_page()) { $ancestors = get_post_ancestors($post); if ($ancestors) { $ancestors = array_reverse($ancestors); foreach ($ancestors as $crumb) { echo '<a href="'.get_permalink($crumb).'">'.get_the_title($crumb).$separator.'</a>'; } } } if (is_single()) { if (has_category()) { $category = get_the_category(); echo '<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.$separator.'</a>'; } } if (is_category()) { $category = get_the_category(); echo ''.$category[0]->cat_name.''; } if (is_tag()) { echo ''.__('Tag','tempera').''.$separator.single_tag_title('', false); } // Current page if (is_page() || is_single()) { echo ''.get_the_title().''; } echo '</div>'; } elseif (is_home() && $tempera_frontpage!="Enable" ) { // Front page echo '<div class="breadcrumbs">'; echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a> '.$separator; _e('Home Page','tempera'); echo '</div>'; } } } // tempera_breadcrumbs() add_action('after_setup_theme','remove_fonction_parent2'); function remove_fonction_parent2() { remove_action('cryout_before_content_hook','tempera_breadcrumbs'); add_action ('cryout_before_content_hook','tempera_breadcrumbs1'); } /*You have to change the information about your theme.
August 28, 2015 at 7:48 am #165973In reply to: Add/Change User roles
sbskamey
ParticipantHi Robkk, I’d like to change the capabilities for the roles, so I think adding the new roles would be better.
When I move my code to my Child Theme, my website goes blank.
Do you know if theres something that I’m missing?
This is my Child Theme with the 3 new role and new capabilities in it… (when I add this code to the core bbpress files, it works, but now that I moved it to my Child Theme, my site goes blank).
<?php // enqueue the child theme stylesheet Function wp_schools_enqueue_scripts() { wp_register_style( 'childstyle', get_stylesheet_directory_uri() . '/style.css' ); wp_enqueue_style( 'childstyle' ); } add_action( 'wp_enqueue_scripts', 'wp_schools_enqueue_scripts', 11); //code to add roles function add_new_roles( $bbp_roles ) { /* Add a role called team member */ $bbp_roles['bbp_teammember'] = array( 'name' => 'Team Member', 'capabilities' => custom_capabilities( 'bbp_teammember' ) ); /* Add a role called teammember */ $bbp_roles['bbp_communitymember'] = array( 'name' => 'Community Member', 'capabilities' => custom_capabilities( 'bbp_communitymember' ) ); /* Add a role called ambassador */ $bbp_roles['bbp_ambassador'] = array( 'name' => 'Ambassador', 'capabilities' => custom_capabilities( 'bbp_ambassador' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 ); function add_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_teammember' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_communitymember' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_ambassador' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'teammember' role */ case 'bbp_teammember': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'edit_others_forums' => true, 'delete_forums' => true, 'delete_others_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'communitymember' role */ case 'bbp_communitymember': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => false, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); /* Capabilities for 'ambassador' role */ case 'bbp_ambassador': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => false, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); break; default : return $role; }August 28, 2015 at 3:21 am #165968sivaramapandian
Participanthi friends,
Me too, breadcrumb is not showing only in forum pages.
Previously i had WordPress SEO plugin. Now disabled that too. But still i am not getting breadcrumb. No code is done. Latest bbpress has been installed as it is.
Please help
Thanks
August 27, 2015 at 9:45 pm #165953Robkk
ModeratorIts some pagination code inherited from the template bbPress is using for its pages.
You might need to create a bbpress.php file from the file bbPress is inheriting from and place it in your child theme and also remove any post meta like the by that is usually for displaying the author of a blog post.
If you are using Genesis, I think installing the bbPress Genesis Extend plugin will solved most bbPress layout issues.
-
AuthorSearch Results