Search Results for 'code'
-
AuthorSearch Results
-
November 25, 2015 at 1:39 am #169363
In reply to: Need help about my bbpress setup
seyibest
ParticipantThanks @Robkk for the respond. but i have question about
Put this loop-forums.php file in your child theme in a folder called bbpress.
i only have child theme for the theme but bbprss is a plugin. are you saying i have to create a child theme for the plugin bbpress of how do i do that please?
There is a plugin called bbp style pack that can give you a shortcode to display the latest number of topics on your site. bbPress has this shortcode for the forum archive, [bbp-forum-index]
You said there is a plugin to display latest post, how do i get the plugin?
Thank you so much.
November 24, 2015 at 9:02 am #169347Pascal Casier
ModeratorHi,
To remove the messages above and below, you could use CSS like:.bbp-template-notice { display: none; }or use a plugin like bbP Toolkit.
To change the message so it includes the standard bbPress login, you would have to copy ‘bbpress/templates/default/bbpress/form-reply.php’ to your child theme and then adapt the file. On line 175 add:
<p> <?php echo do_shortcode ('[bbp-login]') ; ?>
so that it becomes:<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p> <p><?php echo do_shortcode ('[bbp-login]') ; ?></p>If you want to do something different, this is anyway the place to start from.
Pascal.
November 24, 2015 at 2:41 am #169333Robkk
ModeratorMy function is just using a hook and some custom code to add an image. Put the code in your child themes functions.php file instead.
November 24, 2015 at 2:03 am #169329In reply to: smiley emoticons
Robkk
ModeratorPlease find enclosed a link for the test Website:
Well I am not seeing an issue with my forums disappearing with WP Monalisa activated.
Where do I activate TinyMCE and find the default toolbar editor in WordPress? Or are you talking about BBPress Dashboard?
Well your not using TinyMCE so you would see the error I come across. Like said there is an issue, so you may not need to activate it. There is a plugin on wordpress repository and a code snippet in the codex to allow TinyMCE.
As previously mentioned it didn’t work with a freshly installed bbPress Website. I had nothing else installed except the bbPress Forum. The enclosed totius.tk however is now a plugin.
Yes, wordpress plugins do not work for the old standalone version, but with the plugin version. I cannot test to see if an install of bbPress v1 would cause an issue, as I cannot run this on wamp. Kind of do not know how to install bbPress v1 anyway.
Sorry, I forgot to post the WordPress Dashboard that comes up for Settings/Writing:
A new version of WordPress probably removed the smilies setting like the wp monalisa plugin says, there was a version with that setting before.
November 24, 2015 at 1:36 am #169328In reply to: Forum no load the entire “Post Area” – Broken Theme
Robkk
ModeratorJust ignore that error, it might be caused by something other than bbPress.
If you did not try the plugin troubleshooting already, do so.
November 24, 2015 at 1:30 am #169325In reply to: Need help about my bbpress setup
Robkk
Moderator@seyibest Put this loop-forums.php file in your child theme in a folder called bbpress.
https://github.com/robkk/bbPress-Hierarchical-Forum-and-Category-Layout
so, how do i make it to be in a place like just only Login/Register on just a menu bar like
They added custom menu item links in the menu section. You can create links leading to the WordPress login/register forms. There is also this php code snippet here to add links, you might need to add a conditional to it for a specific menu.
add_filter( 'wp_nav_menu_items', 'rkk_add_auth_links', 10 , 2 ); function rkk_add_auth_links( $items, $args ) { if (is_user_logged_in() { $items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>'; } elseif (!is_user_logged_in() { $items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>'; $items .= '<li><a href="'. site_url('wp-login.php?action=register') .'">Register</a></li>'; $items .= '<li><a href="'. site_url('wp-login.php?action=lostpassword') .'">Lost Password</a></li>'; } return $items; }and moreso, i made the homepage to be the forum. how can i code it in such a way that 2-3 of my post will appear on the homepage follow by the forum beneath it?
There is a plugin called bbp style pack that can give you a shortcode to display the latest number of topics on your site. bbPress has this shortcode for the forum archive, [bbp-forum-index]
November 24, 2015 at 12:40 am #169318In reply to: Forum no load the entire “Post Area” – Broken Theme
Robkk
ModeratorThere could be a plugin that affects TinyMCE that could be causing this issue. Try some plugin troubleshooting.
I could also check out your theme if you tell me what it is.
November 24, 2015 at 12:21 am #169314In reply to: how to add span class bbp-topic-started-in
Robkk
ModeratorOh I forgot, put the customized
loop-single-topic.phpyou have to a folder called bbpress in your child theme. bbPress should then use that file, and you should see the changes immediately.November 23, 2015 at 11:32 pm #169311In reply to: Login, Register, Lost Password links
Robkk
ModeratorYou can just use the code I posted here. It is more customizable then the other one in the codex article and the other topic you linked to. I might change it in the codex article later on to this one too.
You can put a custom page like this
'/page-slug/'. Here I made it so where when a user logs out they go to a page called “Logout” that has the permalink slug “logout”.add_filter( 'wp_nav_menu_items', 'rkk_add_auth_links', 10 , 2 ); function rkk_add_auth_links( $items, $args ) { if (is_user_logged_in() && $args->theme_location == 'sub-header-menu') { $items .= '<li><a href="'. wp_logout_url('/logout/') .'">Log Out</a></li>'; } elseif (!is_user_logged_in() && $args->theme_location == 'sub-header-menu') { $items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>'; $items .= '<li><a href="'. site_url('wp-login.php?action=register') .'">Register</a></li>'; $items .= '<li><a href="'. site_url('wp-login.php?action=lostpassword') .'">Lost Password</a></li>'; } return $items; }November 23, 2015 at 11:24 pm #169310In reply to: Search results take me back to my homepage
Robkk
ModeratorSince I see you have Avada, you may need to go through some plugin troubleshooting.
Also your notification bar says for users to not register, you can disallow that by going into Settings > General and disable Anyone can register. Enable it again whenever you want.
November 23, 2015 at 11:00 pm #169309In reply to: bullets in front of everything
Robkk
ModeratorTry this custom css, I think I got ahold of most of the styles you would need to fix this issue. Make sure to place these CSS styles into your child themes stylesheet or anywhere else you can place custom CSS styles into, like in a separate plugin
#bbpress-forums ul>li { overflow-x: visible !important; overflow-y: visible !important; padding-left: 0 !important; } #bbpress-forums ul>li:before { margin-left: 0 !important; content: ‘‘ !important; margin-right: 0 !important; bottom: 0 !important; position: relative !important; display: block !important; } #bbpress-forums li { color: inherit !important; margin: 0 !important; }November 23, 2015 at 10:45 pm #169308In reply to: Remove commas between tag display
lissyhunnybee
ParticipantI’m not a theme author or a coder, I just muddle through with what I find on Google for a lot of php stuff lol but I am learning every time someone shows me a better way to achieve something 🙂
Thank you!
November 23, 2015 at 10:04 pm #169307In reply to: Remove commas between tag display
Robkk
ModeratorYou could have done what most theme authors do with the post tag list when they are customizing it and replace
<?php bbp_topic_tag_list(); ?>with something like this.<?php bbp_topic_tag_list( 0, array( 'sep' => '' ) ); ?>November 23, 2015 at 8:59 pm #169301In reply to: bbpress permalink issues
Robkk
ModeratorOn my menu on wordpress I am getting link.com/forum-4/ and I cant remove the “-4”?
Well you created a page called forum 3 other times that is why it adds the -4 to the end.
If you are creating a “forum page”, know that you really do not have to do this. Just go to /forums or whatever the forum root slug is set in your forum settings in Settings > Forums.
I’m getting the same error on bbpress with some forums.
Are you naming a forum, “forum”??
Also, where is the function for users to register and their profiles?
Since your using the bbPress plugin, you register through WordPress login and register forms. bbPress has some shortcodes you can place in a page, and they will redirect you to the default WordPress forms since they aren’t really dedicated forms.
Profiles should be present if users click their name on the bbPress login widget, the author link in their posts, or you can add a custom menu item using a function in this guide.
November 23, 2015 at 12:35 pm #169290In reply to: bullets in front of everything
Pascal Casier
ModeratorHi kallard,
The best place to start from would probably be the bbpress codex: https://codex.bbpress.org/themes/
If you are not really sold on this theme, try to look for bbpress compatible themes to get started faster.
Pascal.November 23, 2015 at 12:25 pm #169289Topic: How to remove title prefixes ‘Topic:’ & ‘Forum:’ ?
in forum TroubleshootingDealL
ParticipantHow to remove Title prefixes ‘Topic:’ and ‘Forum:’?
I can see these tickets :
https://bbpress.trac.wordpress.org/ticket/1764
&
https://bbpress.trac.wordpress.org/changeset/5018are discussing the issue but I don’t know how to use them.
Do I upload the files attached in the topics as plugins? Or do I paste the code from the files in functions.php of my child theme?
Kindly help
Thank you
November 23, 2015 at 8:29 am #169282In reply to: Login, Register, Lost Password links
mica123
ParticipantHello again,
many apologies for causing a misunderstanding here. All the login/logout links work. I was only asking about the profile link after logout – this is also fine. My question can be ignored.
Many apologies to @robkk. The profile link code is his – taken from How to add user profile link to specific menu
Thanks.
November 23, 2015 at 7:03 am #169279In reply to: bbp_new_forum hook
Antipole
ParticipantHi… I am trying this. I want to auto-subscribe all users to new forums and I have tried the following:
function ovni_subscribe_all_users_to_new_forum($forum_id){ // subscribe all users to a new forum echo 'ovni_subscribe_all_users_to_new_forum fired'; // this function will fire on all wp-insert_posts - only act if is for a new forum if ((get_post($forum_id)->post_type == bbp_get_forum_post_type()) && !wp_is_post_revision( $forum_id )){ // have just posted a new forum $all_user_ids = get_users(); foreach ($all_user_ids as $user){ bbp_add_user_forum_subscription($user_id, $forum_id); } } } add_action(save_post, ovni_subscribe_all_users_to_new_forum, 90,1);When I load the New Forum admin page, the echo trace statement appears at the top of the New Forum page, before it has been submitted.
Can SKS help here please?
November 22, 2015 at 10:58 pm #169270In reply to: Remove commas between tag display
lissyhunnybee
ParticipantIt may not be the most elegant solution but the following worked for me….
In your theme’s functions.php place this code:
//* Remove Commas in BBPress Post Tag Display function my_bbp_topic_tag_list( $topic_id = 0, $args = '' ) { echo my_bbp_get_topic_tag_list( $topic_id, $args ); } function my_bbp_get_topic_tag_list( $topic_id = 0, $args = '' ) { // Bail if topic-tags are off if ( ! bbp_allow_topic_tags() ) return; // Parse arguments against default values $r = bbp_parse_args( $args, array( 'before' => '<div class="bbp-topic-tags"><p>' . esc_html__( 'Tagged:', 'bbpress' ) . ' ', 'sep' => '', 'after' => '</p></div>' ), 'get_topic_tag_list' ); $topic_id = bbp_get_topic_id( $topic_id ); // Topic is spammed, so display pre-spam terms if ( bbp_is_topic_spam( $topic_id ) ) { // Get pre-spam terms $terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true ); // If terms exist, explode them and compile the return value if ( !empty( $terms ) ) { $terms = implode( $r['sep'], $terms ); $retval = $r['before'] . $terms . $r['after']; // No terms so return empty string } else { $retval = ''; } // Topic is not spam so display a clickable term list } else { $retval = get_the_term_list( $topic_id, bbp_get_topic_tag_tax_id(), $r['before'], $r['sep'], $r['after'] ); } return $retval; }Then copy
bbpress\templates\default\bbpress\content-single-topic.phpinto your theme bbpress folder and replace<?php bbp_topic_tag_list(); ?>with<?php my_bbp_topic_tag_list(); ?>Hope that helps others looking to do the same thing, and if there’s a better solution let me know lol
November 22, 2015 at 12:55 pm #169263In reply to: Login, Register, Lost Password links
mica123
ParticipantHello,
I hope you won’t mind if I come back to this topic. Everything works with the login and logout links – both redirecting to a certain page. I added the profile link to the menu which shows up after a user login (taken from Layout and functionality – Examples you can use as follows:
function rk_bbp_menu_profile_link( $items, $args ) { if( is_user_logged_in() && $args->theme_location == 'sub-header-menu') { $current_user = wp_get_current_user(); $user = $current_user->user_nicename; $profilelink = '<a href="/ihabbpress/tenant-forums/users/' . $user . '/">Your Profile</a>'; $items .= '<li>' . $profilelink . '</li>'; } return $items; }This is fine except that when the user logs out, he/she stays on the same profile page
he/she had been on before logging out. This is not good – users should be redirected to a specific page. I thought that this code would automatically inherit the redirection link from the Logout code. Many thanks.November 22, 2015 at 10:38 am #169261In reply to: how to add span class bbp-topic-started-in
danceee3
Participanti cut the ifs but nothing happens, should have said this before, i am in no mean a programmer i did this
<?php do_action( 'bbp_theme_before_topic_started_in' ); ?> <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> <?php do_action( 'bbp_theme_after_topic_started_in' ); ?>is this correct?
November 21, 2015 at 8:17 am #169235Topic: create menu style forums?
in forum Troubleshootingamalto
Participanti can create forums as a drop-down menu? I would like to create forums as if they were a drop-down menu, but I can not with css code…
November 20, 2015 at 8:13 pm #169231In reply to: Pagination for Forums Listing
Robkk
ModeratorThanks for the snippet, but will that add pagination or just put more forums on the page?
There is no pagination for the forum archive page. There is this, but it outputs pagination for a single forum page.
<?php bbp_forum_pagination_links(); ?>I might have to create a ticket to possibly add this in the future.
I’d love to come up with some kind of awesome method to self organize all of these books, but that is unlikely to happen given the many restraints.
I was thinking a better tagging system might help, but yeah.
November 20, 2015 at 6:15 pm #169224In reply to: Pagination for Forums Listing
Robkk
ModeratorAdd this php function to your child themes functions.php file or in a plugin like functionality to increase the total ammount of forums in the page. It may also be better to just show the Topics by Freshness in the forum root instead by setting it in Settings > Forums.
function rkk_increase_forum_per_page( $args ) { $args['posts_per_page'] = get_option( '_bbp_forums_per_page', 150 ); return $args; } add_filter( 'bbp_before_has_forums_parse_args', 'rkk_increase_forum_per_page' );November 20, 2015 at 6:06 pm #169223In reply to: bbpress floated with 34.000 post, how to delete?
Robkk
ModeratorAt least i could prevent further entries in the two respective foren by using a math captcha and let only registered users to open new themes or respond to older ones
From what I am reading on your post, you had anonymous posting activated and without spam protection even, which is the reason why there are a lot of spam posts on your forums. Having anyone to post on forums even without an account to your site will allow spammers to just wreck havoc. And from visiting your site I can tell most of the posts are from users without an account posting on your forums.
I have de- an reactivated bbpress, un- and reinstalled it, but the messages are still there.
Doing that doesn’t delete your posts.
Since I see that there are a few posts from 2013 here and there, then most of the spam posts seem to come around October, you may need to suggest a nuclear option and possibly just delete all your bbPress forum post data in whole and start over. I am only suggesting this as i can see about 3 legitimate topics in a forum, then everything else was spam. To delete all of bbPress posts and data you have to follow this guide here and run the Reset Forums Tool. While trying to run this, tell me if it stalls up and gives you an error.
If you have a backup of your database dating back before all the spam wrecked havoc, you can also restore that and be fine, but you will possibly lose some new data like new blog posts that you might of have created.
If you do not make regular backups, make sure after the forum data is cleaned up, that you start doing so.
Remember that when you are starting a forum, you will need to have some kind of spam protection in your forums from the start, especially if you are allowing people to post without an account. Also make sure to have some moderators on your site to catch any activity as it happens.
-
AuthorSearch Results