Display bbPress Posts Without A Plugin

Have you tired of using an old version of bbPress? Do you want bbPress Posts without a Plugin? bbPress is an open-source forum software that has been used for a long time by website owners to better site performance and SEO.

Unlike other forum software you do not feel that much trouble in installing and managing this plugin, but nowadays this troubling the users and causes issues like posting problems, creating viruses, no replies, etc. If you are getting the same issues, so do not worry.

We have created this blog or all you guys. In this, we have shared about bbPress Posts without a Plugin. It may sound weird or less impressive, but this going to solve your problem easily. No doubt, you have several plugins to use instead bbPress. But, if you are looking for the best and easy method then you do not need to waste your time to explore one of our fantastic tricks.

So, are you excited?

We found this personal trick after years of hard work and planning. Our major reason to use bbPress is getting replies and posting content to the forums, right? All you need to display content and getting replies.

And these days, the forum has closed the replies and feature only content. For the future, you can use USP Pro to reuse forum for both sharing views and posting content. Here, we will talk about only the present issue i.e display content in the forum.

BBpress Posts Without A Plugin
So this is our whole blog about. Remember, you can use this method if you want to ditch bbPress or getting trouble with this. The other thing you should keep in mind it is not a verified solution, this is a simple technique to display the content or posts without plugin in bbPress. Also, this is a simple way to access the forum with ease.

Maybe these steps going to irritate you because you have to use coding. Well, if you are master in it then you will excite to do that.

Let us get started!

Before getting started, first you have to create a backup of your website data. As you are going to take a risk or playing with codes. Make sure you have backup your data via genuine resource, it is because of precaution. In case you have done anything wrong, you can easily manage your site with a quick backup.

How To bbPress Posts Without A Plugin?

There are a few steps you have to do.

Step One- Add Support To CPT’s

Previously, you are working on bbPress so you have all data as posts and replies. But now you are not using bbPress, but you have stored database. And both required support to Custom Post Types. So to do this, you have to see the given tutorial and our job is to display post and replies, so you have to add support accordingly. Follow the given code and to do so, go to functions.php file.

// add support for topic cpt

Function shapeSpace_topic_cpt () {$labels=array (

‘name’=>__ (‘Topics’, ‘ShapeSpace);

‘Singular _name’ =>__ (‘Topics’, ‘ShapeSpace);

‘menu_name’=>__ (‘Topics’, ‘ShapeSpace);

‘name_admin_bar’=>__ (‘Topics’, ‘ShapeSpace);

‘add_item’=>__ (‘Add New’, ‘ShapeSpace);

);

$args=array (

‘labels’=> $labels,

‘taxonomies’=> array(),

“public’=> true,

);

// add support for reply cpt function ShapeSpace_reply_cpt () {$labels =array (

‘name’=>__ (‘Replies’, ‘ShapeSpace);

‘Singular _name’ =>__ (‘Reply’, ‘ShapeSpace);

‘menu_name’=>__ (‘Replies’, ‘ShapeSpace);

‘name_admin_bar’=>__ (‘Add New’, ‘ShapeSpace);

‘add_item’=>__ (‘Add New Reply’, ‘ShapeSpace);

);

$args=array (

‘labels’=> $labels,

‘taxonomies’=> array(),

“public’=> true,

);

Add this code without changes. And also you consult to WP Codex to customize everything as per your needs. Make sure you are using the proper code to display topic and reply.

Step Two- Display Content

Now, we need template to display the content and replies. And the simple way to do this is to add the given code. First you need to add new page and add work on custom template with given code.

<?php

/* Template Name: Forum Posts */

/* this is a temporary page template for looking up old forums posts and see also functions.php for creation of related custom posts types */

?>

<?php get_header (); ?>

<div class=”content” id=”content”>

<article class=”wrap”>

<?php if (current_user_can (‘manage_options’)) : ?>

<?php // Topoics

$paged = (get_query__var (‘paged’)) ? get_query__var (‘paged’) :1;

$args = array (‘post_type’=> array (‘topic), ‘posts_per_page’=> 1, ‘paged,’order’=> ‘ASC’); // forum, topioc, reply

$temp=$wp_query;

$wp_query= null;

</article>

</div>

<php get_footer (); ?>

It is page template which you can add directly to any custom page. For example:
/mytheme/page-custom.php)

Here Are The Things Which You Can Check After Applying These Codes:

  • You will get the theme header template.
  • We have used the $paged variable for easy navigation for the user. With this, you will get easy access to navigation links so you and the user can browse the forum topics quickly.
  • It will start the loop for topics. With this, it will display the title of content with metadata and forum.
  • You will get another loop for replies where it will display the ID of the replied person, reply title, and other useful information.
  • With manage_options, admin can easily check the forum posts and navigate then. Well, this option is all up to you for use, if you do not want other admins can see posts, you do not need to use this.
  • Ensure you have use two loops as wp_reset_variable_postdata () to restore $post variable in query.
  • To add navigation links use previous_post_link () and next_post_link ().
  • To play safe, you must add wp_reset_query () to restore $wp_query.

Final Thoughts

Let me clear with you again that bbPress Posts without a Plugin is just a way to avoid bbPress plugin. This has been shared only to make you more forward and safe for future problems.

This can be done easily, but you have to be extra careful while adding coding in functions.php file. To see the best example you can try it on the WP file which is random. This can help to display your forum topics with titles and replies with the user’s ID. Best of Luck!

About Sonnal S Sinha

Sonnal S SinhaSonnal S Sinha is a passionate writer as well as WordPress and WooCommerce rockstar who loves to share insights on various topics through his engaging blog posts. He runs a successful website design and digital marketing company. With 15+ years of experience in WordPress theme development, he strives to inform and inspire readers with his thought-provoking content. He helps thousands of small and medium businesses and startups create a unique online presence. Follow Sonnal S Sinha for your regular dose of knowledge and inspiration.

Do check out our free WordPress themes and WordPress themes bundle