Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,126 through 7,150 (of 32,519 total)
  • Author
    Search Results
  • #170473
    dezzzus
    Participant

    Hi,
    I want forum looking like phpbb, example below. Where I marked the categories and forums must look like.
    I trying to detect categories with this code:

    <?php $q_meta_forums1 = array( 'meta_key' => '_bbp_forum_type', 'meta_value' => 'category'); ?>
    <?php $categories_q = new WP_Query( $q_meta_forums1 ); ?>

    But $categories_q returns nothing. It’s the main problem for now.
    So, then I want in loop-forums.php with code above build categories structure and in ‘while’ cycle make another one which will be show sub-forums of categories.
    Example

    #170470

    In reply to: Two forum index pages?

    najuste
    Participant

    Problem is the same, but design is from WordPress.. and the website now is on my local mashine.
    Here is the php of created bbpress.php
    Code is really simple:

    <?php get_header(); ?>
    	<div id="primary">
    		<div id="content" role="main">
    
    			<?php if ( have_posts() ) : ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php get_template_part( 'content', get_post_format() ); ?>
    				<?php endwhile; ?>
    				<?php twentyeleven_content_nav( 'nav-below' ); ?>
    			<?php endif; ?>
    			
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    But the two pages look different..

    Website crop

    Looking at html I have noticed, that newly created page has a different body class assigned and so is not recognized as bbpress forum archive page, but rather as a page..
    <body class="page page-id-902 page-template page-template-bbpress page-template-bbpress-php custom-background single-author singular two-column left-sidebar">

    The breadcrubs issue I have noticed just when I read this..
    As that I guess will get fixed after the the page will be understood as forum archive page..

    #170440
    Pascal Casier
    Moderator

    Hi,
    Sorry it took me some time, but this hopefully works. Just add in a functions.php or so.
    Will add it in next version of my bbP Toolkit …

    function casiepa_change_admin_links_sep($args) {
    	$args['sep'] = '';
    	return $args;
    }
    add_filter('bbp_after_get_topic_admin_links_parse_args', 'casiepa_change_admin_links_sep' );
    add_filter('bbp_after_get_reply_admin_links_parse_args', 'casiepa_change_admin_links_sep' );
    

    Pascal.

    #170439
    dezzzus
    Participant

    ok, may be you know how to distinguish forum type via WP_Query()?
    $query = new WP_Query('post_type=category'); – not working.

    #170434

    In reply to: Forum root not showing

    Pascal Casier
    Moderator

    It should be sufficient to create a page at that permalink and add the [bbp-forum-index] shortcode in it.

    Pascal.

    #170431

    In reply to: Forum root not showing

    David Artiss
    Participant

    No sooner had I posted then I found the cause – it’s my theme. Switched to another and it appears.

    I suspect it’s to do with the fact that it’s not pointing to a physical page. Can I create a page as the root and use a shortcode to display the contents? When I’ve tried to change the root name to my page name it throws up an error.

    David.

    najuste
    Participant

    Thanks, I checked that page before, that is why I have bbpress.php file.
    Just for the sake of interested I again tried, copied the code from given link instead of using get_template_part, however no difference.
    Constructed page is then visualized as default template, streched in full extent, without any sidebar..

    One more thing:
    I see that the body class assigned to that constructed page is like for a simple post, has tags like
    page, page-id-xx, page-template, page-template-bbress .. while the automatically created forum page has forum-archive, bbpress..
    Does it make sense, should I try to change body class??

    Pascal Casier
    Moderator
    najuste
    Participant

    I just can’t figure it out with the templates noomatter how much I am googling as I am new and can’t get what exactly the problem is. I have followed so many different tutorials, but well, they didn’t lead where I want.

    What I have:
    a website running localy with a child theme of twentyeleven with a sidebar.
    After installing bbpress, the the default forum page ‘sitename/forum’ was well visualized, but the sidebar was empty and the forum did not have full extent.
    I wanted to add text before the forum itself as well as create a new sidebar and so created a new page ‘sitename/forums’ choosing ‘Sidebar Template’, with text and then shortcode [bbp-forum-index]. Also created a new sidebar an registered it. Searching for changes created bbpress.php which is simply my index.php (as I can’t find any php file named template.. just sidebar.php, which is not the one I want.). Also tried to make same php as template adding * Template Name: Forum Template to be able to chose it from dashboard.

    Now I have:
    *default forum page [sitename/forum]- that has a view as I want, till the moment I click on the topic that gets displayed as page per whole extent while also showing the bbpress sidebar = overlapping.
    *created forum page [sitename/forums] that I indeed want to have, that has this overlaping problem, and not displaying the bbpress sidebar instead the usual one.

    Checking with firebug it is clear that on default forum page, articles are presented as forum pieces, but in the created forum page they are simply presented as articles.
    So I suspected I should change smth here instead of the content calling smth different.. <?php get_template_part( 'content', get_post_format() ); ?>
    However it just looks like nor my created template, nor page bbpress.php is understood as bbpress page.. (as my sidebar is checking that and so it does not appear).

    If someone could direct where/what to read or try out I would really appreaciate,
    Thanks in advance,

    #170405
    Pascal Casier
    Moderator

    Probably something with this function so adding [Delete] or a button after every topic title

    // define the bbp_template_after_topic_tag_edit callback 
    function casiepa_bbp_template_after_topic_tag_edit(  ) { 
        echo '  <a href="">[Delete]</a>'; 
    }; 
    // add the action 
    add_action( 'bbp_theme_after_topic_title', 'casiepa_bbp_template_after_topic_tag_edit', 10, 0 );

    Or maybe better only when they open the topic itself ?

    But as said I’ll have another look in the next days.
    Pascal.

    Karthikeyan KC
    Participant

    This is really a bummer for lot of my users. After hours of research into the codes, I just found the ticket, addressing why <li> breaks the site (being an invalid HTML).

    Sorry for this bump(ish) post. Is there a temporary workaround or fix for this? For now, I’m planning on putting up a custom notice, advising the participants not to use </li><li> the wrong way.

    Also, I’m curious how bbPress (this forum) handles this.

    Edit: I think the issue is self-explanatory here.

    #170377
    Pascal Casier
    Moderator

    Hi Jessicana,
    If you want to make it yourself very easy, install my ‘bbP Toolkit’ where you can just flag away these boxes.
    If you don’t want to install the plugin but want to play with CSS, then the below should hide the message, but not only that one as also these ones will be gone:
    – You must be logged in to create new topics
    – Your account has the ability to post unrestricted HTML content
    – Maximum file size allowed
    – …

    .bbp-template-notice {
    	display: none;
    }
    
    .bbp-template-notice.info,
    .bbp-template-notice.error,
    .bbp-template-notice.important,
    .bbp-template-notice.warning {
    	display: block;
    }

    EDIT: Moderators are asleep, ssssttt !

    Pascal.

    #170374
    ivurs
    Participant

    Hello,

    It doesnt work, I add these code in the end of functions.php file

    but get an error of this file and make the website cannot be accessed

    Please provide more guidance, thanks!

    #170352
    Pascal Casier
    Moderator

    Extra info: If you use Avada 3.8.8 on WP 4.4, make sure to apply all the fixes:
    https://theme-fusion.com/knowledgebase/avada-3-8-8-blog-shortcode-doesnt-work-after-wordpress-4-4-update/

    Pascal.

    #170309
    Laserfj
    Participant

    Yes–it was a private parent forum. Ok good news and bad news–I replaced the code in post.php:
    if ( ‘publish’ === $parent->post_status ) {

    replaced with
    if ( ! empty( $parent ) ) {

    The permalink has been fixed, but now I am getting errors:
    Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-includes/post.php:1) in /public_html/wp-admin/post.php on line 197

    Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-includes/post.php:1) in /public_html/wp-includes/pluggable.php on line 1228

    What does this mean?

    #170299
    kypo
    Participant

    Hi All.

    I think that I have a similar problem, maybe the same problem.
    If anyone advise me I will be very grateful.
    Unfortunately I am not a programmer and I can not help myself.

    I tried to insert this code from @gperez-tl

    add_filter('bbp_get_reply_position', 'lugpa_get_reply_position', 10, 3);
    function lugpa_get_reply_position($reply_position, $reply_id, $topic_id){
        
        if(empty($topic_id))
            $topic_id = bbp_get_reply_topic_id ($reply_id);
        
        $numReplies = bbp_get_topic_reply_count($topic_id);
        return ($numReplies+1) - $reply_position; // plus one because of thread description
    }

    into my theme functions.php but it does not work for me.

    For example, in this topic:

    3.1.2016 Supercars @ Brands Hatch

    Links to first posts (#9129) refers to the wrong url to page2, but this post is still on page1…
    Other post urls on this page1 is OK. When i go to page2 every post has bad URL refers to page1.

    Please help if you can… Thanks

    #170282
    Robin W
    Moderator

    seems it is pasting the date of the original topic, not the date of it’s latest reply.

    so the site is posting

    <a title="2016 Targets" href="http://www.harrisonchapmankarate.com/forums/topic/2016-targets/">1 week, 1 day ago</a>
    
    

    when it should be posting

    <a title="Reply To: 2016 Targets" href="http://www.harrisonchapmankarate.com/forums/topic/2016-targets/#post-3442">17 hours, 55 minutes ago</a>

    what theme and plugins are you using?

    #170269
    Robin W
    Moderator

    The code you have under the title is

    .add-new-post-header2 .container {
    border-bottom: 1px solid #ecf0f1;
    }

    Are you using a wordpress page with [bbp-forum-index] in it?

    #170266

    In reply to: Border colour

    yandoos
    Participant

    I’ve managed to do it with the following css.. I do wonder if there is a more efficient way?

    .entry-title {
    background: #212121;
      border-color: #000000 !important;
    }
    
    #bbpress-forums div.odd,
    #bbpress-forums ul.odd {
    background: #212121;
      border-color: #000000 !important;
    }
    
    #bbpress-forums div.even,
    #bbpress-forums ul.even {
      border-color: #000000 !important;
    background: #212121;
    }
    
    #bbpress-forums {background:#212121 !important;}
    #bbpress-forums ul li{background:#212121 !important; border-color: #000000 !important;}
    #170265

    Topic: Border colour

    in forum Troubleshooting
    yandoos
    Participant

    Hello I was hoping for some help please . I’ve just made the background colour of my forum a darker shade (see below) and now I need to change the border colours from white to a slightly duller shade.

    How can I do this please?

    .entry-title {
    background: #212121;
    }
    
    #bbpress-forums div.odd,
    #bbpress-forums ul.odd {
    background: #212121;
    }
    
    #bbpress-forums div.even,
    #bbpress-forums ul.even {
    background: #212121;
    }
    parmaker
    Participant
    1. When visitors come to a forum and click a topic from the topic index list, bbpress elegantly shows the lead topic and replies and Reply-to form on the topic page.
    2. I wanted to hide the reply form box, instead, put a link of pointing to a regualr wordpress page so that only visitor who wants might write a reply for that topic by clicking the link.
    3. So I copied a page from parent theme dir into the child theme dir, and named “forum_new_reply_form.php” and changed like :

      /**<br>
      * Template Name: Forum New Reply Form<br>
      *<br>
      * @package WordPress<br>
      * @subpackage Twenty_Sixteen<br>
      * @since Twenty Sixteen 1.0<br>
      */<br>

      get header(); ?><br>

      < div id=”primary” class=”content-area”><br>
      < main id=”main” class=”site-main” role=”main”><br>
      < ?php <br>
      // Start the loop.<br>
      while ( have_posts() ) : the_post();<br>
      // nothing to do here <br>
      endwhile;<br>
      ?><br>
      < ?php <br>
      global $wp_query;<br>
      if (isset($wp_query->query_vars[‘reply_to_this_topic’]))<br>
      { <br>
      ?><br>
      < div class=”my-bbp-reply-form”><!– bbp-reply-form –><br>
      < ?php <br>
      $reply_shortcd = ‘[bbp-reply-form topic_id=”‘ . $wp_query->query_vars[‘reply_to_this_topic’] . ‘”]’;<br>
      echo do_shortcode($reply_shortcd);<br>
      ? ><br>
      < / div><!– bbp-reply-form –><br>
      < /main><!– .site-main –><br>

      < ?php get sidebar( ‘content-bottom’ ); ?><br>

      < / div><!– .content-area –><br>
      <br>
      get sidebar()<br>
      get footer() <br>

    4. Go back to functions of childtheme, put this action

      add_action(‘bbp_template_after_single_topic’,’my_bbp_reply_form’);<br>
      function my_bbp_reply_form() {<br>
      if (!current_user_can(‘publish_replies’)){<br>
      return;
      }
      $t = ‘< div class=”my-bbp-new-reply-form-link”>’; <br>
      $t .= ‘< a href=”http://kabum/write_reply_page/?reply_to_this_topic=&#8217; . bbp_get_topic_id() . ‘” title=”‘ . bbp_get_topic_title() . ‘”>’;<br>
      $t .= ‘< /a>< / div>’;<br>
      echo $t;<br>
      }

    5. From content-single-topic.php, commented out

      bbp_get_template_part( ‘form’,’topic’);<br>

      so, i can see the lead topic and a link mentioed at 4), and replies if any.

    6. For debugging purpose, I copied form-reply.php into childtheme/bbpress, changed one line like this :

      // printf( __( ‘Reply To: %s’, ‘bbpress’ ), bbp_get_topic_title() );<br>
      echo ‘I am replying to ‘ . bbp_get_topic_title();<br>

      under < legend > of < fieldset > of that file.

    7. When I clicked the link which was added at 4), a reply form pops up without any topic and replies !! hurray !!!

      But disaster !!, <br> the page http : / /kabum/write_reply_page/?reply_to_this_topic=1234<br>
      shows <br>
      I am replying to “forum title” (the title of the regular page housing the template “Forum New Reply Form”)<br>

      It should have shown <br>
      I am replying to “topic title” (of topic id 1234)

    8. I learned that bbp_topic_id and bbp_reply_to are 0, that triggered fetching parent id of a topic.

      The page source of browser does even show html < input hidden name=bbp_topic_id value in the page.<br>
      The page of http://kabum/write_reply_page/?reply_to_this_topic=1234, exactly tells <br>
      reply_to_this_topic is 1234

    9. I changed topic_id of shorcode bbp-reply-form atts with reply_to before retrying.<br>

      Same thing happened.

    10. At the writing of this post, bbpress org documentation regarding to bbp-reply-form shortcode,<br>
      is not clearly saying about shortcode atts, but topic is [bbp-topic-form forum_id=$forum_id].
    11. in case topic creation, i did the similar way as mentioned above, works fine. no need to do with jquery stuff.
    12. bbpress outof box has action as h t tp://kabum/forums/topic/topic_title/#newpost, but my reply form page is
      h t tp://kabum/topic_title/?reply_to_this_topic=1234, i.e./forums/forum is sit in or not. In my reading of showrcode source, I can’t find any clue of hansdling atts reply_to hopfully i was wrong reading.

    ==

    Hopfully, looking forward to anyone’s help.

    #170257
    rayjay
    Participant

    Hey guys
    I am creating a link to creat new Topic form and using the
    href=”mysite/forum/<?php bbp_forum_id(); ?>/#new-post”>Create New Post

    I get the links parsed as
    href=”mysite/forum/6/#new-post”>Create New Post

    notice the 6!
    I have permalinks on so how to force the shortcode forum name?

    Thanks

    #170256
    rayjay
    Participant

    Sorry I was off line during the holidays..

    Glad to hear you have sorted it now..

    It is usually better to have a copy of the orginal code with you if you hava customized theme for comparison and help recevied from here and most of the help you would get here would be based on the default plugin code and theme..

    #170251

    In reply to: Need advice

    Robin W
    Moderator

    The best advice I can give you is to create a test site for each of your live sites.

    This not only allows you to test new plugins, be confident in taking and using backups but also be happy that you can re-create your site should your host provider go bankrupt and you lose everything.

    https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/

    #170249

    Topic: Need advice

    in forum Installation
    DYTW
    Participant

    I am keen to create a forum for my 2 websites that have been in existence for over a year in order to entice visitors to hang around and engage each other on key topics that are very dear to me. I originally intended to use MyBB for my 2 websites World Of Leathers and CarBuyerSg but received advice from MyBB forum members that the current different WordPress themes on my websites are not suitable for MyBB and will likely conflict with it.

    I downloaded bbPress for both websites but didn’t dare to activate them after it crashed another website of mine that was a one Page website using the free So Simple Theme By Press75. The So Simple theme is one of the cleanest and most basic free WordPress theme available with really clean codes and meant for simple basic websites so I am now really afraid to activate it on my 2 websites that are using premium WordPress themes from Studio Press and Elegant Themes. Does anyone have any experience using bbPress for the Lifestyle Pro Theme by Studio Press or the Divi Theme by Elegant Themes?

Viewing 25 results - 7,126 through 7,150 (of 32,519 total)
Skip to toolbar