Search Results for 'code'
-
AuthorSearch Results
-
February 12, 2014 at 9:25 am #142410
In reply to: Distinct forum users and admin users
barnabe
Participant– How to hide the WP toolbar by default when a user registers?
I found this code to add in functions.php theme file:
add_filter('show_admin_bar', '__return_false');– I use the bbPress’ form register template, how to redirect users to a specific page after submit and not to the WP’s form login?
I found this code to add in functions.php theme file:
function bbp_form_register_custom_redirect() { return 'URL here'; // Ex : return get_permalink(73); } add_filter('bbp_user_register_redirect_to', 'bbp_form_register_custom_redirect');But with this code, when there is an error (like username already exists), the redirect is not effective.
Any idea?
February 12, 2014 at 5:55 am #142404In reply to: Remove – Display the login screen.
Robin W
ModeratorI think those words are in your page 322
You should just have the following in contents
[bbp-login]I think you have
[bbp-login] - Display the login screen.February 12, 2014 at 5:38 am #142400In reply to: White box covering Forum screen
Robin W
Moderatorok, think the ones on the page link are around line 90 (my .css is different, so exact lines may vary) – look for
#bbpress-forums li.bbp-header, #bbpress-forums li.bbp-footer { background: #f3f3f3; border-top: 1px solid #eee; font-weight: bold; padding: 8px; text-align: center; } #bbpress-forums li.bbp-header { background: #eaeaea; }and change background to the same as above.
They may be some others as you go through. Come back with any that are still niggling, and I’ll chase them down for you.
As you are making changes to bbPress templates, make a copy of the file onto your PC, and keep a list of what you changed, as any bbPress updates will override this file.
You should revisit child themes when you get some more time, as this is a better way to do it, but the way you’re doing will work fine (and was what I did in the early days!).
February 12, 2014 at 2:03 am #142391In reply to: WP_Query post type topic help
hitkid
Participant*edit*
I’ve tried all of the documentations functions*<?php $args = array( ‘post_type’ => ‘topic’, ‘posts_per_page’ => 10 ); $the_query = new WP_Query( $args );?> <?php if ( $the_query->have_posts() ) : ?> <!– pagination here –> <!– the loop –> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php bbp_author_link( array( ‘post_id’ => bbp_get_forum_last_active_id(), ‘size’ => 32 ) ); ?> <a class=”bbp-topic-permalink” href=”<?php bbp_topic_permalink(); ?>” title=”<?php bbp_topic_title(); ?>”><?php bbp_topic_title(); ?></a> <?php endwhile; ?> <!– end of the loop –> <!– pagination here –> <?php wp_reset_postdata(); ?> <?php else: ?> <p><?php _e( ‘Sorry, no posts matched your criteria.’ ); ?></p> <?php endif; ?>February 12, 2014 at 2:01 am #142390In reply to: WP_Query post type topic help
hitkid
ParticipantI don’t need their role or title. For some reason the avatars will just not come up in the loop outside of the mychild/bbpress/loop-single-forum.php files and mychild/bbpress/loop-single-topic.php. So it works fine on index pages.
I’ve tried all of the but nothing
Here’s what the code looks like right now:
<?php $args = array( 'post_type' => 'topic', 'posts_per_page' => 10 ); $the_query = new WP_Query( $args );?> <?php if ( $the_query->have_posts() ) : ?> <!-- pagination here --> <!-- the loop --> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 32 ) ); ?> <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a> <?php endwhile; ?> <!-- end of the loop --> <!-- pagination here --> <?php wp_reset_postdata(); ?> <?php else: ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?>This worked for getting the original post author, but I need the latest active poster to appear
<?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>Is there a wordpress function equivalent for this function: bbp_get_forum_last_active_id() that I can use with get_avatar() ?
What file do these functions reside in? Maybe I could copy the functions out and make new ones in mychild/functions.php or see if something wrong and replace the file?
Thank you for the help!
February 12, 2014 at 12:25 am #142386In reply to: Importing from Vanilla
Stephen Edgar
KeymasterThere is a broad outline here: https://codex.bbpress.org/import-forums/
Some more Vanilla specif info here: https://codex.bbpress.org/import-forums/vanilla/
Essentially you should be able to open up your Vanilla Config file in a text editor:
eg.
/public_html/dev/vanilla/conf/config.php`
// Database
$Configuration[‘Database’][‘Name’] = ‘ntwb_vanilla2’;
$Configuration[‘Database’][‘Host’] = ‘localhost’;
$Configuration[‘Database’][‘User’] = ‘ntwb_wpdev’;
$Configuration[‘Database’][‘Password’] = ‘abc123’;
`Use the values you have in the bbPress importer screen.
To get the table prefix you might have to open phpMyAdmin on your hosting providers control panel (cPanel)
In this image my table names have a
gdn_prefix, this is what you would use.I am pretty sure
gdn_is the default and used by most installs.
February 11, 2014 at 10:03 pm #142384In reply to: White box covering Forum screen
domainhorizon
ParticipantThanks so much Robin,
I had problems setting up a child theme and have ended up ditching that for the moment and just edited your code directly into the bbpress.css file.
It half worked! http://www.luciddreamingland.com/dream-journal/
I’ve tried fiddling with the bbpress.css some more but without luck.
If you have any more suggestions that would be great.
Really appreciate your efforts.
Thanks.
February 11, 2014 at 6:42 pm #142380In reply to: Social media Share button missing
AITpro
ParticipantWe were looking for a plugin that already did this and did not find what we wanted so we created this simple solution here: http://forum.ait-pro.com/forums/topic/buddypress-bbpress-social-media-share-button-code/
This is lightweight HTML code outgoing Share links to keep website resource usage very low since the Social Media buttons are being loaded per Reply.
February 11, 2014 at 5:18 pm #142375In reply to: Forums list does not appear correctly on my site
thajskyraj
ParticipantProblem solved! I found the small error in code. Now its working. Thanks a lot for your advise and guide Robin!
February 11, 2014 at 4:22 pm #142373In reply to: Forums list does not appear correctly on my site
thajskyraj
ParticipantNearly there 🙂 I found I made an error in code, so I corrected it and now sidebar widgets are corrected. The only last problem I have is that the forum is there twice.
February 11, 2014 at 4:20 pm #142372In reply to: Forums list does not appear correctly on my site
thajskyraj
ParticipantNearly there :-), I made an error in code. I corrected it and side bar is now corrected. The only last problem I have now is that the forum is there twice :-).
February 11, 2014 at 4:07 pm #142371In reply to: Forums list does not appear correctly on my site
thajskyraj
ParticipantThanks Robin, I guess I understand you completely. I did exactly what you advised me to do and it actualy works, however I am not certain what exact code of bbpress theme should I put there.
The code of page.php looks as follows:
<?php get_header(); ?>
<?php get_template_part(‘loop’, ‘page’); ?>
<?php get_footer(); ?>The questions is what piece of bbpress template code should I put between the header and footer. Now I put there code copied from bbpress/templates/default/extras/page-front-forums.php, and its some improvement, however it is still not correct as it put the sidebare widgets under it instead of its correct location.
If you can advise what code should I put there, then it will be perfect solution.
Thanks a lot for your efforts and time.
February 11, 2014 at 2:17 pm #142366Robin W
ModeratorNo problem,
Several ways to do this, the easiest is to add the following to your theme’s style.css file:
.widget_display_topics .bbp-author-avatar { display: none ! important; } .bbp-topic-freshness-author .bbp-author-avatar { display: none ! important; }or if you are using a child theme, put in in the bbpress.css in your css folder
If you need further help, just come back and ask, or visit
February 11, 2014 at 11:54 am #142361In reply to: bbpress sidebar
Robin W
Moderatorpresume you are using the code is_bbpress() in your widget logic?
February 11, 2014 at 11:53 am #142360In reply to: bbpress Widget in Child Theme?
Robin W
Moderatorunfortunately you are right. The widgets that bbpress comes with can only be changed by filters, and that may be your solution.
Alternately you can cut the widget code into a plugin. I do this to alter the wordpress login plugin, and once you get into it it’s quite easy, just google creating a plugin for lots fo resources.
You’ll need some plugin code, and then to copy the widget into the plugin. You’ll then need to change the widget name so it doesn’t conflict.
February 11, 2014 at 11:04 am #142352In reply to: Login Widget redirects to dashboard
Robin W
Moderatoruse the bbpress logon widget in a sidebar on your forum page, and it’ll stay on the forums.
edit : sorry just read your entry again, and that’s exactly what you are doing !
I disable dashboard for all my users – untick “show toolbar when visiting site”
If they logout using the widget (which is their only option if they don’t have toolbar), then they don’t get the WordPress login page.
You can customose the generic login form if you want to keep it see
February 11, 2014 at 11:01 am #142350Topic: current_user_can Issue
in forum Troubleshootingttyler333
ParticipantI have been trying to enable the ability for the author to delete their own posts. I am running bbPress 2.5.3-5249 and based on my analysis
current_user_can("delete_reply", $post->ID);seems to be the problem, I created a capability “delete_reply” and still didn’t succeed. I read documentation but it said delete_replies. I have spent too much time on this one thing. I can make the bbpress work so the user can delete their own posts but it’d be after modifying files I really should only have to hook into. Anyone have any advice or tips?February 11, 2014 at 10:44 am #142346In reply to: White box covering Forum screen
Robin W
Moderatorit’s coming from bbpress stylesheet.
there may be a quicker way to remove this, but one that should work is as follows.
I don’t think you have a childtheme, and now may be the time to consider having one, see https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-2/ for more details
once done you need to navigate to
wp-content/plugins/bbpress/templates/default/css/bbpress.css
copy this file into a folder called css within your theme, so you end up with
wp-content/themes/mychildtheme/css/bbpress.csswhere mychildtheme is the name of your childtheme
Then edit every line that has
background-color : xxxxxxx
change to
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4);
NOTE it goes from background-color to background
and it is only the background color that you’ll be changing, not lines which just have color: as that’ll be text!eg
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background-color: #f4f4f4; }becomes
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4); }This will make the background transparent, but with a darker tint shading that you have in your sidebar (the amount of difference is on the 0.4 bit, 0.1 is the lightest, 1.0 the darkest).
Come back if that doesn’t fix it, or for further help
February 11, 2014 at 10:05 am #142345In reply to: widget context – are forum topics same as posts?
Robin W
Moderatorthe answer is probably yes – a forum post is a post
You might do better to install bbPress WP Tweaks Widget Logic plugin which gives you a forum specific sidebar
alternately (or additionally) use widget logic where you can use code like
is_bbpress()or the negative!is_bbpress()to control where widgets are shownFebruary 11, 2014 at 9:42 am #142342In reply to: How do you put the "My Profile" link on the menu?
Robin W
Moderatorok, that all looks fine.
The error as far as I can work out says that it has an unexpected ‘/ ‘ on the evaluated code on line 4 – so for the code in the profile page line 4 is
?>/edit/">However this may not be a line 4 error, but something that is missing or not evaluating correctly on an earlier line.
I’d try the following
Recheck that the code is pasted exactly as it should be, with no missing characters eg ‘;’s from ends of lines etc. The lines posted in my previous post go passed the visible, so did you scroll to the right – just checking the obvious first !
that your domain is spelled correctly etc.
Then I’d try removing the / from the start of line 4 – the edit bit, and the from the end of the edit bit – I don’t think that’s the problem, but try it anyway.
The just form my sanity copy the code from your page back into a post here, and I try it on my site to see if I get the error.
Then we’ll see where we go from there !
`February 11, 2014 at 7:17 am #142338In reply to: WP_Query post type topic help
Stephen Edgar
KeymasterAre you only to show the avatar? (i.e. Not their, role or title etc)
This should work to display only the current topic author user’s avatar without their display name or user role and with an avatar size 60px.
<?php bbp_topic_author_link( array( 'show_role' => false, 'type' => 'avatar', 'size' => 60 ) ); ?>February 11, 2014 at 4:40 am #142331In reply to: How do you put the "My Profile" link on the menu?
aravindbachu
Participant@robin-w , I am sorry for those remarks. I am actually more frustrated with myself for not being able to come up with a solution for that.
I have also seen that you have tried a lot to answer this particular question plaguing this board.
I have already tried Ronthai’s solution, but this is what pops up on my page :
Parse error: syntax error, unexpected ‘/’ in /home/knolzgig/public_html/wp-content/plugins/wp-exec-php/wp-exec-php.php(652) : eval()’d code on line 4I am unable to understand this now. there were / in many places… and I didn’t understand which one was causing the trouble, which unexpectedly shouldn’t have come in the first place.
February 11, 2014 at 4:39 am #142330In reply to: How do you put the "My Profile" link on the menu?
aravindbachu
Participant@robin-w , I am sorry for those remarks. I am actually more frustrated with myself for not being able to come up with a solution for that.
I have also seen that you have tried a lot to answer this particular question plaguing this board.
I have already tried Ronthai’s solution, but this is what pops up on my page :
Parse error: syntax error, unexpected ‘/’ in /home/knolzgig/public_html/wp-content/plugins/wp-exec-php/wp-exec-php.php(652) : eval()’d code on line 4I am unable to understand this now. there were / in many places… and I didn’t understand which one was causing the trouble, which unexpectedly shouldn’t have come in the first place.
February 11, 2014 at 4:15 am #142329koendb
ParticipantYou could just put it in your functions.php file.
If it’s empty put this on the first line:
<?phpGeneral information about adjusting your theme (and functions.php): Making a child theme
February 11, 2014 at 2:55 am #142328In reply to: remove rel=nofollow from bbpress posts
malkah
ParticipantHi
It didnt work. can you look at the code to see if something is not configured correctly?this is how the code looks like after I edited Theme Functions (functions.php) from within the WP dashboard>appearance>editor:
<?php
remove_filter( ‘bbp_get_reply_content’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_topic_content’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_reply_author_link’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_topic_author_link’, ‘bbp_rel_nofollow’ );require_once TEMPLATEPATH . ‘/lib/Themater.php’;
$theme = new Themater(‘HealthPress’);
$theme->options[‘includes’] = array(‘featuredposts’);$theme->options[‘plugins_options’][‘featuredposts’] = array(‘hook’ => ‘main_before’, ‘image_sizes’ => ‘930px. x 300px.’, ‘effect’ => ‘fade’);
if($theme->is_admin_user()) {
$theme->admin_options[‘Ads’][‘content’][‘header_banner’][‘content’][‘value’] = ‘‘;
}
… -
AuthorSearch Results