Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,701 through 12,725 (of 32,521 total)
  • Author
    Search Results
  • #142410
    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?

    #142404
    Robin W
    Moderator

    I 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.
    
    #142400
    Robin W
    Moderator

    ok, 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!).

    #142391
    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; ?>
    #142390
    hitkid
    Participant

    @netweb

    I 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!

    #142386

    In reply to: Importing from Vanilla

    Stephen Edgar
    Keymaster

    There 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.

    #142384
    domainhorizon
    Participant

    Thanks 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.

    #142380
    AITpro
    Participant

    We 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.

    #142375
    thajskyraj
    Participant

    Problem solved! I found the small error in code. Now its working. Thanks a lot for your advise and guide Robin!

    #142373
    thajskyraj
    Participant

    Nearly 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.

    #142372
    thajskyraj
    Participant

    Nearly 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 :-).

    #142371
    thajskyraj
    Participant

    Thanks 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.

    #142366
    Robin W
    Moderator

    No 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

    Step by step guide to setting up a bbPress forum – part 2

    #142361

    In reply to: bbpress sidebar

    Robin W
    Moderator

    presume you are using the code is_bbpress() in your widget logic?

    #142360
    Robin W
    Moderator

    unfortunately 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.

    #142352
    Robin W
    Moderator

    use 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

    https://codex.wordpress.org/Customizing_the_Login_Form

    #142350
    ttyler333
    Participant

    I 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?

    #142346
    Robin W
    Moderator

    it’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.css

    where 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

    #142345
    Robin W
    Moderator

    the 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 shown

    #142342
    Robin W
    Moderator

    ok, 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 !
    `

    #142338
    Stephen Edgar
    Keymaster

    Are 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 ) ); ?>

    #142331
    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 4

    I 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.

    #142330
    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 4

    I 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.

    #142329
    koendb
    Participant

    You could just put it in your functions.php file.

    If it’s empty put this on the first line:

    
    <?php 

    General information about adjusting your theme (and functions.php): Making a child theme

    #142328
    malkah
    Participant

    Hi
    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’] = ‘Free WordPress Themes‘;

    }

Viewing 25 results - 12,701 through 12,725 (of 32,521 total)
Skip to toolbar