Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 501 through 525 (of 32,358 total)
  • Author
    Search Results
  • #236640
    newtech1
    Participant

    Back end

    So I want the custom field to show up here on the Front-end:

    FYI the following code displays the custom field in the Front-end on pages, page.php in the template.

    echo ‘Lake Marker 2: ‘ .get_field( ‘lake_marker_point_2’ );

    #236637
    newtech1
    Participant

    I need this custom field in the front end of any topic post. I want it to show up underneath the bottom of the topic field.

    Here is other code ACH generates. Not sure which one to use and what fle it is to be inserted into.

    <div id=”view” class=”acf-view acf-view–id–57 acf-view–object-id–65″>
    <div class=”acf-view__row acf-view__lake_marker_point”>
    <div class=”acf-view__label”>Lake Marker Point</div>
    <div class=”acf-view__field”>This is the marker location</div>
    </div>
    </div>

    One more possible code:

    echo ‘Lake Marker: ‘ .get_field( ‘lake_marker_point’ );

    <div class=”acf-view__row acf-view__lake_marker_point”>
    <div class=”acf-view__label”>Lake Marker Point</div>
    <div class=”acf-view__field”>This is the marker location</div>
    </div>

    #236635
    Robin W
    Moderator

    ok, so this should take them out

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    $message = str_replace ('&nbsp;' , '', $message ) ;
    return ($message) ;
    }

    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

    #236634
    Robin W
    Moderator

    ok, so this should take them out

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    $message = str_replace ('&nbsp;' , '', $message ) ;
    return ($message) ;
    }

    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

    #236632
    itsmifred
    Participant

    Yes Robin, this is working.

    So : I tried again you first add and it is working fine !

    the html space code is still visible in TEXTE mode but not in the email.

    I am very sorry because of still in the TEXTE mode visible I didn’t even tried first time to send a test subject and make you loosing time !

    thank you for your perseverance and kindness.

    I tried on the staging clone but I am going to use it on the production one. Thanks again.

    Fred

    #236631
    Robin W
    Moderator

    ok, try this

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    	//$message = str_replace ('&nbsp;' , '', $message ) ;
    	$message = 'hello'.$message ;
    return ($message) ;
    }

    This should simply add the word ‘hello’ before the message, which will prove that the filter is firing.

    #236629
    Robin W
    Moderator

    ok, just tried that in my test site and the code above seems to work.

    1. can you give me a exactly what you have put into your functions file, with a few lines above and below

    2. are you using any other bbpress related plugins?

    3. are you using any mail related plugins?

    #236622
    newtech1
    Participant

    Here is the ACF shortcode for a custom field. What bbPress template/file do I place this shortcode so that the custom field displays on the frontend of a topic post. Where do I place it.

    [acf_views view-id=”60″ name=”Lake Point Marker 2″]

    #236620
    Robin W
    Moderator

    ok, presuming the characters are exactly this

    &nbsp;

    sorry nothing further I can do.

    if different put that in the appropriate line

    #236615
    Robin W
    Moderator

    ok, so this should take them out

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    $message = str_replace ('&nbsp;' , '', $message ) ;
    return ($message) ;
    }

    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

    #236594
    enkoes
    Participant

    Thanks for the code! I tested and it basically works well.


    @ph59
    if you found not working, try change
    ('12345,34567,78945')
    to
    ('12345','34567','78945')

    Regards.

    #236591
    Robin W
    Moderator

    ok, so put this before it

    <?php

    #236589
    fearless359
    Participant

    The only lines in the child theme functions.php file is the code you gave me. No lines before, nor after it.

    Vivian E
    Participant

    Hello,

    Please help me out with a code which I can use to display user’s topics started and replies created.

    For example, being able to display this page

    with only the “topic started” and “replies created” menu links.

    I will appreciate a custom code which I can use to archive this.

    NB; on the page where I want to display topics started/replies created, I’m also displaying a topic form using bbpress short code. I’d like the display of topics started/replies created to come after the bbpress topic form…

    Thanks in anticipation that someone will help me out here with a code 🙏

    #236573
    Robin W
    Moderator

    ok, again untested but this

    add_filter ('bbp_topic_admin_links' , 'surpress_moderator_links', 10 , 2) ;
    add_filter ('bbp_reply_admin_links' , 'surpress_moderator_links', 10 , 2) ;
    
    function surpress_moderator_links ($links , $id) {
    	
    	if (bbp_is_topic( $id)) $forum = bbp_get_topic_forum_id( $id ) ;
    	if (bbp_is_reply( $id)) $forum = bbp_get_reply_forum_id( $id) ;
    	if (!in_array($forum, array ('12345','34567','78945'))) return $links ;
    	//if user is moderator but not a keymaster...
    	$user_id = wp_get_current_user()->ID ;
    	if (bbp_is_user_keymaster($user_id)) return $links ;
    	if (current_user_can( 'moderate')) {
    		//check if the topic/reply is posted by another moderator, and if so unset the links
    		if (bbp_is_topic( $id)) $author_id = bbp_get_topic_author_id( $id ) ;
    		if (bbp_is_reply( $id)) $author_id = bbp_get_reply_author_id( $id ) ;
    		if (bbp_get_user_role( $author_id)  == 'bbp_moderator') {
    			 unset ( $links ['approve'] );
    			 unset ( $links ['spam'] );
    			 unset ( $links ['trash'] );
    			 unset ( $links ['move'] );
    			 unset ( $links ['split'] );
    			 unset ( $links ['edit'] );
    			 unset ( $links ['move'] );
    			unset ( $links ['merge'] );
    			unset ( $links ['close'] );
    			unset ( $links ['stick'] );
    		
    		}
    	}
    return $links ;
    }

    just change ‘array (‘12345′,’34567′,’78945′))’ to have a list of the forum ID’s you want to check against

    #236572
    Philippe Roussel
    Participant

    Thank you.

    I will definitely keep this code handy. I will have several forums and need the code to function only for what will be the “Training” category of forums. Can this category be implemented in the code?

    #236569
    Robin W
    Moderator

    @ph59 – ah I see, then yes try the code above, if it doesn’t work, let me know and I’ll try and find time to fix it

    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

    #236567
    Robin W
    Moderator

    maybe …not one the bbpress authors allowed for 🙂

    anyway, totally untested as I need to be doing other things, but this might do it
    revised code below

    of course if moderators are allowed into the backend, then this becomes pointless, but I would argue that only admins should be backend access 🙂

    #236561
    fearless359
    Participant

    I put the code in the child theme functions.php file.

    #236544

    In reply to: Problem with theme

    Robin W
    Moderator

    I presume you are adding the adrotate with a shortcode – yes?

    #236498
    lmstearn
    Participant

    Hi,
    WordPress 6.2.2 running Twenty Twenty-Three theme, BBPress 2.6.9.
    Moved the only hidden (pending) topic from a public forum to a private forum, and published it. Topic, and moved replies all look fine in the private forum.
    The public forum from whence it was moved still has this:

    This forum has NN topics (+1 hidden), NNN replies …

    As expected, clicking the +1 hidden doesn’t change the number of topics displayed. Repaired the forum, cleared site cache, no change to the +1 hidden.
    If a detail in the move topic process was missed, please advise.
    Thanks.

    Ronny Kreuzberg
    Participant

    Hello, i am using this code Part to show latest Topics in certain Forums. It is giving the correct Topic ids but wont show them except of original Language even if i opened it in a different language first.

    <section class=”topics”>

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

    <h3><?php echo __(‘Recent Topics’, ‘WordPress’); ?></h3>

    <?php

    $topic_parents = array();

    foreach ($match_parent_ids as $match_parent_id) {

    $match_ids = get_children(array(
    ‘post_parent’ => $match_parent_id,
    ‘post_type’ => ‘forum’,
    ‘fields’ => ‘ids’,
    ));

    foreach ($match_ids as $match_id) {

    $topic_ids = get_children(array(
    ‘post_parent’ => $match_id,
    ‘post_type’ => ‘topic’,
    ‘fields’ =>’ids’,
    ));

    foreach ($topic_ids as $topic_id) {
    echo $topic_id;
    }

    $topic_parents = array_merge($topic_parents, $topic_ids);

    }

    }

    $args3 = array(
    ‘post__in’ => $topic_parents,
    ‘post_type’ => ‘topic’,
    ‘post_status’ => bbp_get_public_status_id(),
    ‘posts_per_page’ => 10,
    ‘orderby’ => ‘freshness’,
    ‘order’ => ‘DESC’,
    );

    if (bbp_has_topics($args3)) :

    bbp_get_template_part(‘loop’, ‘topics’);

    else :

    bbp_get_template_part( ‘feedback’, ‘no-topics’ );

    endif;?>

    </div>

    </section>

    Thanks for helping

    #236487
    Neha wilas
    Participant

    You can update your .htaccess something like.
    RewriteEngine On

    # Redirect forum index URLs to shortcoded pages
    RewriteCond %{REQUEST_URI} ^/forum-index$
    RewriteRule ^(.*)$ /shortcoded-page [L,R=301]
    
    # Exception: Exclude specific paths from redirection
    RewriteCond %{REQUEST_URI} !^/forum1$
    RewriteCond %{REQUEST_URI} !^/forum2$
    RewriteRule ^(.*)$ - [L]
    

    With these rules, any request to /forum-index will be redirected to /shortcoded-page, except for requests to /forum1 and /forum2 which will not be redirected.

    #236483
    Robin W
    Moderator

    try this

    add_action( 'wp_footer', 'bsp_supports_js' );
    
    function bsp_supports_js() {
    	echo '<script>document.body.classList.remove("no-js");</script>';
    }

    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

    #236471
    Robin W
    Moderator

    create a new page and title it what you want the title to be

    add a shortcode block

    with

    [bbp-forum-index]

    then add this page to your menus

Viewing 25 results - 501 through 525 (of 32,358 total)
Skip to toolbar