This is the plugin for using shortcodes in menu – hope this helps ?
Shortcode in Menus
Found it. Download the plugin: bbpress do shortcodes
But where can you enable shortcodes? I also have this problem with the polls.
Sorry
The two shortcodes are, I assume they can work independently so does not need to work in conjunction with[bsp-profile] ?
[Profile label=’This is the label’]
[Profile label=’This is the label’]
there are 6 shortcodes in style pack, can you clarify which 2 you mean?
Image didn’t help me 🙁
No problem and any time you spend with this is great news for us all.
The [bsp-profile] now works perfectly for both single names and double spaced names and for myself, job done.
I did try the other two shortcodes and alas for myself they do not work at all, when either is placed in the menu or onto a page as a shortcode, then the shortcode is shown in menu, not the result of the shortcode,
please see image link for clarity and I assumed the remaining two shortcodes would work the same as [bsp-profile] i.e, just add and it works?
forum layout
[Profile label=’Edit My Profile’ edit=’y’]
Yes. I copied bbpress’s template to my child theme, and not I put my original template but I add codes to bbpress’s templates.
For example,
before “form-user-register.php”
<input type="text" name="user_login" value="<?php bbp_sanitize_val( 'user_login' ); ?>" size="20" id="user_login" maxlength="100" autocomplete="off" />
after “form-user-register.php”
<input type="text" name="user_login" value="<?php bbp_sanitize_val( 'user_login' ); ?>" size="20" id="user_login" maxlength="100" autocomplete="off" placeholder="half-width characters" />
Shortcodes are not allowed in bbpress post as default. You need to check your code/plugin which allows shortcodes in bbpress posts, there might be the problem.
We’ve been using wp-poll to insert polls into topics, but after moving web hosts and upgrading to bbPress 2.6.6 and WordPress 5.5 the shortcodes don’t appear to be working.
If I create a topic and put in the shortcode ‘[poll id=”93″]’, the post simply shows that shortcode. It doesn’t look like the shortcodes being rendered.
Has anyone seen this before, or have ideas on what I can try to get polls working again?
Thanks!
This is more a question to the author of the theme you are using. Start with this.
If the theme is not intended for bbpress, you can make a separate page (item in the menu) – for example, using shortcodes – to create page user profile.
The bbpress shortcodes are in the bbpress codex.
If this is still difficult, there are special plugins
Sorry I might not have explained what I’m trying to accomplish properly.
The shortcode I’m currently using on my live site is this:
[bbp-single-topic id=4657]
Just the normal bbpress shortcode to show the content of the actual topic. I used some CSS code to remove the post form and any replies. So it shows only the first post in a topic which is what I want to display as news on my front page from different forums. The shortcode you listed does show the stickies but just the actual forum topic and not the content of the first post of that forum topic.
I wasn’t sure if there was a shortcode that displays the content of the first post from “x” amount of topics from a specific forum.
So on my page I have three codes that are pulling a single topic from 3 different forums.
I think my style pack plugin might do what you want
bbp style pack
then use
[bsp-display-topic-index show=’1′ forum =’10’ template = ‘short’ show_stickies=’true’ noreply=’true’]
see
dashboard>settings>bbp style pack>shortcodes for how to use
this is what I might out in style pack
add_action ('bbp_template_before_single_forum' , 'bsp_template_notices') ;
add_action ('bbp_template_before_single_topic' , 'bsp_template_notices') ;
function bsp_template_notices() {
// Bail if no notices or errors
if ( ! bbp_has_errors() ) {
return;
}
// Define local variable(s)
$errors = $messages = array();
// Get bbPress
$bbp = bbpress();
// Loop through notices
foreach ( $bbp->errors->get_error_codes() as $code ) {
// Get notice severity
$severity = $bbp->errors->get_error_data( $code );
// Loop through notices and separate errors from messages
foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
if ( 'message' === $severity ) {
$messages[] = $error;
} else {
$errors[] = $error;
}
}
}
// Display errors first...
if ( ! empty( $errors ) ) : ?>
<div class="bbp-template-notice error" role="alert" tabindex="-1">
<ul>
<li>
<?php echo implode( "</li>\n<li>", $errors ); ?>
<a href="#new-post">
<?php _e('Click here to correct', 'bbp-style-pack') ; ?>
</a>
</li>
</ul>
</div>
<?php endif;
}
so what are you using to login – bbpress login widgets, shortcodes or what?
Hello, I use a widget bbpress that allow the option to display “members online” but I can’t separate the normal members and the admin members
Can I use shortcodes or a custom html to insert that options on my homepage? using elementor builder?
Hi there!
Check it out my new BBPress forum site with customs design and codes:
https://bolhabrasil.org/
Cheers!
Hello, my skills are too limited to do that. I’ve simply moved it carefully to be visible for all.
Can you please remove all our posts previous posts to clean the topic ?
TO CONCLUDE :
function rew () {
if ( is_user_logged_in() ) {
echo '<p><a href="http://your_url/new-posts"><div class="newposts">Show new posts</div></a></p>' ;
}
else
echo '<p><a href="http://your_url/new-posts"><div class="newposts">Show new posts</div></a></p>' ;
}
Put this into function.php of your child theme
.newposts {
float: left;
background-color:#DD9933;
padding: 5px 6px;
margin:5px 5px 2em 0;
}
.newposts a {
color:#f2f2f2 !important;
border:none;
border-radius:0;
box-shadow: none;
color:#ffffff;
font-size:13px;
}
And put that into your custom style.css. If your button doesnt appear while your loggued or while you’re not, take care of the margin and the padding of the CSS!
You will have to create a new page “new-posts”. Add [bbp-topic-index] to this page to display your topics in order (most recent ones). If you need a more customizable list, install BBP-Style Pack and go to the Shortcodes section.
Thank you for input
I found what caused issue.
the call for visual composer footer in a shortcode was:
apply_filters( ‘the_content’, $the_post->post_content );
The apply of do_shortcode to $the_post->post_content before echo fixed the text format output of shortcodes and footer now works.
Thank you.
Hi
This is a major issue with bbpress and I could not find a resolution to it. I found couple of similar requests but no one have full resolution.
Basically, if page can be recognized as is_bbpress() true than the footer shortcodes breaks.
How to fix that? Is there some patch?
sorry, working across many things and missed that.
so that page is made up of ‘all topics’ and ‘recent topics’ – are these shortcodes on a page, or how is this page content created?
Coding to do ID’s is possible I suspect, but I have no idea how to do that 🙂
This article suggests that urls are used for seo ranking
https://moz.com/learn/seo/url
and says
A well-crafted URL provides both humans and search engines an easy-to-understand indication of what the destination page will be about.
Although URLs can include ID numbers and codes, the best practice is to use words that people can comprehend.
Just a thought.
Hi again,
I added this code:
if ( function_exists( 'bbp_enqueue_script' ) && function_exists( 'bbp_get_version' ) ) {
bbp_enqueue_script( 'bbpress-engagements', 'js/engagements.js', array( 'jquery' ), bbp_get_version(), true );
}
so now it looks like this:
add_shortcode( 'bbpresscomments', function() {
$output = '';
$current_id = function_exists( 'vcex_get_the_ID' ) ? vcex_get_the_ID() : get_the_ID();
$topics = new WP_Query( array(
'post_type' => 'topic',
'posts_per_page' => -1,
'fields' => 'ids',
) );
if ( $topics->have_posts() ) {
// enqueue scripts on this next line...
if ( function_exists( 'bbp_enqueue_script' ) && function_exists( 'bbp_get_version' ) ) {
bbp_enqueue_script( 'bbpress-engagements', 'js/engagements.js', array( 'jquery' ), bbp_get_version(), true );
}
foreach( $topics->posts as $topic ) {
if ( get_the_title( $topic ) == get_the_title( $current_id ) ) {
$output .= do_shortcode( '[bbp-single-topic id="' . intval( $topic ) . '"]' );
}
}
}
return $output;
} );
because I can see that code that enables all functionality including AJAX, is only enqueued for bbPress pages:
https://github.com/bbpress/bbPress/blob/afa6030c3e27c4fe582743074a603d25b5e4de48/src/templates/default/bbpress-functions.php#L151
And it’s not enabled for bbPress shortcodes.
Is this right?
Could you please tell me what is wrong with my code, and why cannot I enqueue the scripts that will enable AJAX for the shortcodes?
Instead of proper enqueuing, my code makes the buttons not work at all, when I click on them, nothing happens.
How can I insert short codes under/above each topic page or whole topic and reply page?