Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,826 through 1,850 (of 32,522 total)
  • Author
    Search Results
  • #219591
    Robin W
    Moderator

    ok, can you change the other one to

    <?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
    <?php 
    $avatar = get_user_meta (bbp_get_reply_author_id(),  'profile-picture' , true) ;
    echo '<li>herestart'.$avatar.'hereend</li>' ;
    ?>
    #219590
    Robin W
    Moderator

    try

    <?php 
    $neighborhood = get_user_meta (bbp_get_reply_author_id(),  'user-subdivision' , true) ;
    echo '<li>'.$neighborhood.'</li>' ;
    ?>

    come back if that doesn’t work

    #219581
    Robin W
    Moderator

    for the avatar, I need to know what is stored in the usermeta, so can you try adding this after line 44

    <?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>

    to get

    <?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
    <?php 
    $avatar = get_user_meta (get_current_user_id(),  'profile-picture' , true) ;
    echo '<li>'.$avatar.'</li>' ;
    ?>

    I need to see if this produces a url or link to media item etc.

    #219580
    Robin W
    Moderator

    ok replace the

    <?php echo 'hello' ; ?>

    with

    <?php 
    $neighborhood = get_user_meta (get_current_user_id(),  'user-subdivision' , true) ;
    echo '<li>'.$neighborhood.'</li>' ;
    ?>

    and let’s see if that does that one first

    #219558
    Robin W
    Moderator

    so we need to work out which theme template is rendering the forum pages

    looking at the page you gave me, I see that the template has a div of

    <div id="content-area" class="clearfix">

    This is probably a common div to several files, but we can use it’s presence to track down the file

    so you need to look in your theme (wp-content/themes/%your-theme-name%) for likely files

    If you have notepad++ (or another text editor that will do this) you can download your theme to your computer and do a search across all the files.

    otherwise you might have files called page.php, single.php, content.php, content-page.php etc.

    in each file where you find the <div id="content-area" then add a further class, but call each one something different

    eg

    <div id="content-area myclass1" class="clearfix">
    <div id="content-area myclass2" class="clearfix">
    etc.

    then use the browser inspector and hopefully you’ll find the class repeated in there which will tell you what template it is using

    then come back

    #219557
    Robin W
    Moderator

    great, so now I need to know the names of the fields you want in the database

    so I need to construct a bit of code that looks like

    $neighborhood = get_user_meta ($user_id, ‘%what_the_field_is_called%’ , true) ;

    so I need %what_the_field_is_called% for both field πŸ™‚

    #219548
    b0nkers2021
    Participant

    Thanks for the quick reply.

    I used to mod forums and CMS’s before WP existed and have not done much since… so I ‘get it’ but don’t know enough to just whip up a bunch of code. haven’t touched PHP but can get through HTML. Would editing the file not also change the layout etc of other pages within the theme or is the forum using something dedicated to it and it only? Essentially, I need to make the forum look like an existing site and change the header at minimum.

    #219547
    Robin W
    Moderator

    bbpress will render pages using a .php file – this can be one of many in your theme.

    It is this file that you will need to edit and put in a child theme to get what you want.

    so how familiar with files, FTP and code are you ?

    #219546
    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php

    transfer this to your pc and edit

    before line 56 which says

    <?php do_action( 'bbp_theme_after_reply_author_details' ); ?>

    add the following

    <?php echo 'hello' ; ?>

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-single-reply.php

    bbPress will now use this template instead of the original

    You should now see ‘hello’ where you want the neighborhood field

    If you get this far, then come back

    #219545
    Robin W
    Moderator

    ok, try this

    add_filter( 'gettext', 'rew_change_text', 20, 3 );
    
    //This function changes the text wherever it is quoted
    function rew_change_text( $translated_text, $text, $domain ) {
    	if ( $text == 'Subscribe' ) {
    	$translated_text = 'Watch';
    	}
    	if ( $text == 'Unsubscribe' ) {
    	$translated_text = 'Unwatch';
    	}
    	return $translated_text;
    }
    #219542
    vincenzon617
    Participant

    Thanks, the code works however only when loading onto the page. When I click to either ‘Watch’ or ‘Unwatch’ the text reverts back to ‘Unsubscribe’ or ‘Subscribe’ until I refresh the page again.

    #219541
    Robin W
    Moderator

    untested, but this should work

    add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_subscribe') ;
    
    function change_subscribe ($args) {
    	$args['subscribe'] = 'Watch' ;
    	$args['unsubscribe'] = 'Unwatch' ;
    return $args ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #219540
    vincenzon617
    Participant

    Hi,

    is there a way to change the text of the subscription button? Currently it says ‘Subscribe’ and ‘Unsubscribe’ and I would like to change to ‘Watch’ and ‘Unwatch’ respectively. I believe the code that can change this is within the file \bbpress\includes\topics\template.php lines 1781 and 1782. I could change them in here but I would rather change them via my child theme if this is possible?

    Thanks!

    #219530
    Robin W
    Moderator

    try

    #post-2399 .bbp-breadcrumb {
    	display: none;
    }
    #219525

    In reply to: Forum root

    Robin W
    Moderator

    AS far as I know this forum just uses the default.

    There are no problems I know of in not using the prefix unless you have other plugins that use ‘topic’ and ‘reply’ as part of their permalinks.

    So it is a matter of personal choice.

    In my opinion, only site owners worry about what the url is !! When I am on any other site, I rarely look at the url, and if I am on say Amazon as I was a moment ago it looked like

    https://www.amazon.co.uk/?ie=UTF8&tag=googhydr-21&hvadid=208892259274&hvpos=&hvexid=&hvnetw=g&hvrand=3531407930769062293&hvpone=&hvptwo=&hvqmt=b&hvdev=c&ref=pd_sl_9djqxtzprt_e

    πŸ™‚ πŸ™‚ πŸ™‚

    #219420
    cassel
    Participant

    Where do I set it to allow shortcodes to show inside bbpress posts?

    #219408
    Robin W
    Moderator

    ‘If it is set to perfection more and more users will use it and the plugin will be active.’

    I agree, but this is free software that I write in my spare time, I get no income for doing this, and have limited time to write code πŸ™‚

    you should find the topic/reply in the dashboard if you have not permanently deleted it.

    #219403
    nayanboost
    Participant

    And another thing, there are shortcodes on many pages. Just haven’t done anything with the profile page template.

    #219399
    Robin W
    Moderator

    just yours, everyone’s, are you using a shortcode on a page?

    #219391
    healtemple21
    Participant

    When I paste the register code into the page, nothing shows up. When I duplicate the same window for the forum-index, that works, in the wp bakery software (changing only the code), nothing happens.

    I hope this helps to clarify. Let me know, thank you for your help
    Roman

    #219385
    healtemple21
    Participant

    Good Day, the shortcode bb-register , login and lost password aren’t working for me on WPBakery. Other bb shortcodes do work, such as bb-topic-index. Thank you for any assistance you can offer.

    #219383

    In reply to: Automatic subscribtion

    Julia
    Participant

    You can customze two file form-reply.php and form-topic.php .

    bbress> templates > default > form-topic.php at line 170

    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
    ↓
    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
    

    bbress> templates > default > form-reply.php at line 104

    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
    ↓
    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
    

    Then the topic and reply are automatically subscribed simply.
    But the participant can uncheck the checkbox about subscription by himself.
    If you do not want participant uncheck the checkbox, you can delete checkbox by CSS.

    Put these customized files in your child theme’s folder-bbpress.

    #219368
    Ricsca2
    Participant

    When topics are created in the forum this is the writing they have of defoult.

    %excerpt<br />[See the full post at: <a href="%url">%title</a>]

    Could you replace like this for all in the next plugin update which with extra space and bold is more visible?

    %excerpt ...<br /><br /><b>See the full post at: <a href="%url">%title</a></b>

    Thank you

    #219358
    juventino199
    Participant

    Thank you very much, the code works perfectly after placed in my child theme.

    #219357
    Robin W
    Moderator

    this (untested) should work

    add_filter ('bbp_after_get_the_content_parse_args', 'change_rows') ;
    
    function change_rows ($args) {
    	if ($args['context'] == 'reply' ) {
    		$args['textarea_rows'] = '6' ;
    	}
    return $args ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

Viewing 25 results - 1,826 through 1,850 (of 32,522 total)
Skip to toolbar