Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 451 through 475 (of 32,358 total)
  • Author
    Search Results
  • #237008
    juanm777
    Participant

    Hi,

    I am using the WP mail SMTP – Plugin, and bbpress is not sending emails (notifications) through this plugin.

    After searching on the web, I found a similar issue on BuddyPress,

    Buddypress registration ignoring WP Mail SMTP

    They solved it with this code:

    add_filter(‘bp_email_use_wp_mail’, ‘__return_true’);

    Is there a similar procedure for bbpress?

    Thanks

    Juan

    #237005
    newtech1
    Participant

    I understand completely. Makes sense.
    I will have to find a plugin that makes it so I can limit permissions and capabilities per user role.
    There is Permissions Pro and Capabilities Pro plugins that give me all that I need but sadly they do not support ‘topic’ posts. Do you know of any other plugins?

    BTW
    I have ACF to work great for me in the backend. All I need to do is put this code in content-single.php Maybe this will help somebody else who is using ACF with BBPress
    `?>
    YOU CHOOSE HOW MUCH INFORMATION YOU ENTER<br>
    Catch Date & Time: <?php the_field( ‘catch_date_time’ ) ; ?><br>
    Anglers: <?php the_field( ‘anglers’ ) ; ?><br>
    Weather: <?php the_field( ‘weather’ ) ; ?><br>
    Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?><br>
    Kept or Released: <?php the_field( ‘kept_or_released’ ) ; ?><br>
    Lake Point Marker: <?php the_field( ‘lake_point_marker’ ) ; ?><br>
    Water_Features: <?php the_field( ‘water_features’ ) ; ?><br>
    Speed: <?php the_field( ‘speed’ ) ; ?><br>
    Fish Depth: <?php the_field( ‘fish_depth’ ) ; ?><br>
    Lake Depth: <?php the_field( ‘lake_depth’ ) ; ?><br>
    Method Used: <?php the_field( ‘method_used’ ) ; ?><br>
    Lure & Color: <?php the_field( ‘lure_color’ ) ; ?><br>

    Image:
    <?php
    $image = get_field(‘image’);
    if( !empty( $image ) ): ?>
    ” alt=”<?php echo esc_attr($image[‘alt’]); ?>” />
    <?php endif; ?> <br>

    <br>
    <br>
    Fishing Location: <?php the_field( ‘location’ ) ; ?><br>
    <?php
    $location = get_field(‘location’);
    if( $location ): ?>
    <div class=”acf-map” data-zoom=”13″>
    <div class=”marker” data-lat=”<?php echo esc_attr($location[‘lat’]); ?>” data-lng=”<?php echo esc_attr($location[‘lng’]); ?>”></div>
    </div>
    <?php endif; ?>

    <style type=”text/css”>
    .acf-map {
    width: 100%;
    height: 400px;
    border: #ccc solid 1px;
    margin: 20px 0;
    }

    If there was a way to make this code or another code to work in the frontend posting topics I would be thrilled to death. BUT ACF will not help me for BBPress and BBPress will not help me for ACF. If I knew code more I am sure I could figure it out. It cannot be that hard.

    #237001
    newtech1
    Participant

    My forum is set up so that a forum user can only post in the backend/dashboard of my wordpress site because I never was able to get ACH plugin to work on the forum frontend. On the backend the ACF is working fantastic when a user posts a new topic.

    However, the new issue is that the only way a forum user can see the topic link in the dashboard is if they are a moderator or higher. My users will not be moderators but participates. Is there a way via code to make it so participants can log into the dashboard and see the topic link.
    http://www.thedoverfamily.com/images/topics_link.jpg

    #236992
    waprothero
    Participant

    Robin:
    Following your simple instructions for a snippet, I just wanted to check to make sure I’m making the test you suggested (thanks, btw):

    Snippet Content, using wpCode snippet plugin:

    add-action(‘plugins_loaded’,’rew_remove_bbp_role’);
    function rew_remove_bb_role'(){
    remove_action( ‘bbp_user_register’,’bbp_user_add_role_on_register’,10,1);
    }

    Snippet location: Universal Snippet

    Is this correct?

    #236982

    In reply to: Hide posts number

    newtech1
    Participant

    Update:
    I put the following code in the customized css for one website and it removed the Voices column, but on another website it did not remove the voices column. Yes, I cleared all cache and used GeoPeeker to make sure it was not a cache issue.
    `li.bbp-topic-voice-count {
    display: none !important;
    }

#236981
newtech1
Participant

I thought another solution was to just put the shortcodes in the wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php file but the shortcodes do not work.

#236980
newtech1
Participant

I am wanting my bbpress tags and bbpress search input form to display on my forum main page just below the bread crumbs.
This is what I understand to do.
A. Copy my page.php template from by theme folder. (..//wp-content/themes/fishingclub)
B. Rename it bbpress.php and upload to the theme folder.
(I do this and the forum main page displays properly.)
Here is the page,php code:

<?php
/**
 * The template for displaying all single pages
 *
 * @package WordPress
 * @subpackage FISHING_CLUB
 * @since FISHING_CLUB 1.0
 */

get_header();

while ( have_posts() ) { the_post();

	get_template_part( 'content', 'page' );

	// If comments are open or we have at least one comment, load up the comment template.
	if ( !is_front_page() && ( comments_open() || get_comments_number() ) ) {
		comments_template();
	}
}
get_footer();
?>

C. Since I want to display bbpress tags and bbpress I need to put these shortcodes in the bbpress.php template: [bbp-topic-tags] and [bbp-search], BUT the page crashes no matter where I put the shortcode.
D. I assume I must put some kind of coding before and after the shortcode. No idea what I need to do.

#236979
newtech1
Participant

I have removed the column titled ‘voices’ by this code in custom css:

li.bbp-topic-voice-count {
    display: none !important;
}

I want to hide the column with the title ‘Posts’. Is there a way to do this also via custom css?

#236976
Robin W
Moderator

ok, for the moment, I’d suggest you add the code snippets plugin, that gives you an area to put it in.

That will let us test to get to a problem definition.

Once we know if this (or something else) is the solution, then we can get it into the right place, but I would prefer to be sure that the code is functioning so code snippets gives that certainty

#236975
waprothero
Participant

Robin, thanks for your response. I’m out of town until Monday and will try out your suggestions then. Some quick question tho. I’m an experienced programmer, but not with wordpress. I’m unclear where to insert these code items. So….
_———-here’s your suggestion
so use this code

—where do I add this this.. To the bbPress functions file?
add_action (‘plugins_loaded’ , ‘rew_remove_bbp_role’) ;

function rew_remove_bbp_role () {
remove_action( ‘bbp_user_register’, ‘bbp_user_add_role_on_register’, 10, 1 );
}

Put this in your child theme’s function file –
I am guessing this goes in wp initiation file.

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

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

#236974
Robin W
Moderator

as a test, let’s stop it adding the forum role on registration to see if that is interfering.

so use this code

add_action ('plugins_loaded' , 'rew_remove_bbp_role') ;

function rew_remove_bbp_role () {
	remove_action( 'bbp_user_register',   'bbp_user_add_role_on_register', 10, 1 );
}

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

and then let me know if this makes a difference

#236973
Robin W
Moderator

ok, but it is the equivalent of asking me to diagnose the strange sound of your car by sending me a photo of the engine. A link lets me see what code is being sent to the browser.

Topics are typically greyed when they are closed – what state is this topic, and have you tried creating others to see if it is juts this one, or all topics are doing it?

#236957

In reply to: Prevent topic replies

Robin W
Moderator

and with this one try

content-single-topic.php

and remove the line

<?php bbp_get_template_part( 'form', 'reply' ); ?>

#236956
Robin W
Moderator

ok, not quite sure why, but in that case

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

transfer this to your pc and edit

take out the line

<?php bbp_get_template_part( 'form', 'topic' ); ?>

which is in twice, so remove 2 times

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/content-single-forum.php

bbPress will now use this template instead of the original

#236955

In reply to: Prevent topic replies

newtech1
Participant

Are you saying to replace the existing code in form-reply.php just with this code? If so my forum page is ‘page not found’.

<?php

/**
 * New/Edit reply
 *
 * @package bbPress
 * @subpackage Theme
 */

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

I believe this shoudk end with
<?
but it still does not work.

#236954
newtech1
Participant

Are you saying that I am to replace all of the code in form-topic.php with just this code:
`<?php

/**
* New/Edit Topic
*
* @package bbPress
* @subpackage Theme
*/

// Exit if accessed directly
defined( ‘ABSPATH’ ) || exit;

if ( ! bbp_is_single_forum() ) : ?>

<div id=”bbpress-forums” class=”bbpress-wrapper”>

</div>

<?php endif;’

If so the when I go to my forum page it says ‘page not found’.

#236953

In reply to: Prevent topic replies

Robin W
Moderator

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

transfer this to your pc and edit

make the file read

<?php

/**
 * New/Edit reply
 *
 * @package bbPress
 * @subpackage Theme
 */

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

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/form-reply.php

bbPress will now use this template instead of the original

#236951
Robin W
Moderator

find
wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

transfer this to your pc and edit

make the file read

<?php

/**
 * New/Edit Topic
 *
 * @package bbPress
 * @subpackage Theme
 */

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

if ( ! bbp_is_single_forum() ) : ?>

<div id="bbpress-forums" class="bbpress-wrapper">

	

</div>

<?php endif;

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/form-topic.php

bbPress will now use this template instead of the original

#236949

In reply to: Prevent topic replies

newtech1
Participant

I need to clarify. I do not want the reply option to appear anywhere in the forum. I do not want the option for replies-just turn off the reply feature.

If I cannot turn off the reply form what file do I go into to remove the code for the reply form so it does not show up?

The problem with making topic closed is it greys out the topic title. I do not want the title to grey out. So if I cannot remove the reply form someway how can I prevent the title from turning grey when closed?

closed topic

#236948
newtech1
Participant

I do not want anyone, including members, to be able to post topics on the frontend of the forum, just through backdoor. How do I remove that option? It appears the code is form-forum.php file but cannot determine what code I need to remove. What I have tried keeps giving me ‘page not found’.remove front end posting

#236946

In reply to: a user login problem

Passepoil
Participant

Hello Robin,
Yes, the site is under development.
I’m thinking of creating a specific button for logging into the account and redirecting the Internet user to the home page afterwards.
I realized that the connection was done well by changing the page afterwards but not on the page where the widget is installed.
Maybe there is a trick (php code in functions.php) to work around this problem?
Thanks for your help.

#236932
Robin W
Moderator

you’re close !!

Untested, but try

add_filter('bbp_topic_admin_links', 'rew_no_trash_topic_except_own', 10, 2);
add_filter('bbp_reply_admin_links', 'rew_no_trash_reply_except_own', 10, 2);

function rew_no_trash_topic_except_own ($links, $topic_id) {
    if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_topic_author_id( $topic_id )) {
			unset($links['trash']);
		} 
	
    return $links;
}

function rew_no_trash_reply_except_own ($links, $reply_id) {
    if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_reply_author_id( $reply_id )) {
			unset($links['trash']);
		} 
	
    return $links;
}
#236931
enkoes
Participant

Today tried testing this very ‘rough’ piece of code, failed hopelessly with my very limited knowledge of coding:

add_filter('bbp_topic_admin_links', 'rew_no_trash_except_own', 10, 2);
add_filter('bbp_reply_admin_links', 'rew_no_trash_except_own', 10, 2);

function rew_no_trash_except_own ($links, $topic_id) {
    if (!bbp_is_user_keymaster() && !bbp_is_topic_author(get_current_user_id(), $topic_id)) {
        unset($links['trash']);
    }
    return $links;
}

I think the direction is somewhat correct. Hope to get expert guide on this issue.

Regards.

#236868
enkoes
Participant

Hi, good day!

How can we come up with a code so that moderators can only trash his OWN topic/reply but not those posted by others? i.e. to hide admin link “bin” for topic/reply posted by others but display “bin” for his own (as moderator) post.

Regards.

#236865
Robin W
Moderator
add_filter ('bbp_get_title_max_length' , 'rew_change_length') ;

function rew_change_length () {
	$length = 160 ;
return $length ;
}

so change length to whatever number you want.

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 - 451 through 475 (of 32,358 total)
Skip to toolbar