Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,076 through 11,100 (of 32,504 total)
  • Author
    Search Results
  • #150017
    wp_maybe
    Participant

    I am trying to implement a search box inside a Buddypress group that searches on the contents of the Group Forum. I found some helpful instructions here

    Basically, I pasted the following code outside the loop in the “content-single-forum.php” file. (Of course this was done to a copy of the bbpress file which I imported into my theme’s bbpress folder):

    <h3>Search Forum</h3>
    <form role="search" method="get" id="bbp-searchform" action="">
    <label for="ts">Search the support forum topics</label>
    <input type="text" name="ts" id="ts" value="<?php echo ( isset( $_REQUEST['ts'] ) ) ? $_REQUEST['ts'] : ''; ?>" />
    <input type="submit" id="searchsubmit" value="Search" />
    </form>

    This code however, performs search only on the topics and not the replies.

    Can someone suggest appropriate modifications to the code so that it searches on both topics and replies rather than just the topics.

    Many thanks!

    #150013

    In reply to: Full Width Forum Help

    watstyl08
    Participant

    You need to make sure that code is at the VERY END of your style.css.

    #150012

    In reply to: Full Width Forum Help

    Robin W
    Moderator

    it’s not taking

    .bbpress #sidebar-secondary {
     display:none ;
    
    }
    

    try

    
    .bbpress #sidebar-secondary {
     display:none !important;
    
    }
    
    #150007

    In reply to: Random Topic Link

    joejozwowski
    Participant

    ok… so I pasted the following into my functions.php page:

    add_action('init','random_post');
    function random_post() {
           global $wp;
           $wp->add_query_var('random');
           add_rewrite_rule('random/?$', 'index.php?random=1', 'top');
    }
     
    add_action('template_redirect','random_template');
    function random_template() {
           if (get_query_var('random') == 1) {
                   $posts = get_posts('post_type=post&orderby=rand&numberposts=1');
                   foreach($posts as $post) {
                           $link = get_permalink($post);
                   }
                   wp_redirect($link,307);
                   exit;
           }
    }

    And then in my menu I created a LINK element and pasted this into the URL field:

    /?random=1

    And all I get is a blank page

    #150001

    In reply to: Full Width Forum Help

    watstyl08
    Participant

    Fixed it!

    I didn’t realize the .css code had to go at the very end of the style sheet.

    Everything works perfectly now

    Thanks for all your help!!

    #149997

    In reply to: Full Width Forum Help

    Robin W
    Moderator

    What can I change to eliminate the sidebar remnants that remain?

    The code in your style.css was supposed to do that ie

    .bbpress #sidebar-secondary {
     display:none ; 
    
    }
    

    I cannot see the other sidebar on your site – have you cleared your cache/refreshed your browser, and if you can still see it tell me which browser (eg IE, Chrome etc.) and give me a specific url

    We should be able to crack this one 🙂

    #149995

    In reply to: Full Width Forum Help

    watstyl08
    Participant

    OK!

    I tried this, and I think we’re getting extremely close 🙂

    Note that you also have to remove this code from your bbpress.php file

    <div class="aside">
    		
    		<?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template. ?>
    

    The only problem with my Forum now is that the “right” sidebar still shows up, albeit below the full-page forum. Check it out here –> http://www.ibeacon.com/forums/forum/ibeacon-com-forums/

    This is my code for the full-page template

    ‘get_header(); // Loads the header.php template. ?>

    </div>

    <?php do_atomic( ‘before_content’ ); // oxygen_before_content ?>

    <div class=”bbpress-wrap”>

    <div id=”bbpress-content”>

    <?php do_atomic( ‘open_content’ ); // oxygen_open_content ?>

    <div class=”hfeed”>

    <?php if ( have_posts() ) : ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php do_atomic( ‘before_entry’ ); // oxygen_before_entry ?>

    <div id=”post-<?php the_ID(); ?>” class=”<?php hybrid_entry_class(); ?>”>

    <?php do_atomic( ‘open_entry’ ); // oxygen_open_entry ?>

    <?php echo apply_atomic_shortcode( ‘entry_title’, ‘[entry-title permalink=”0″]’ ); ?>

    <div class=”entry-content”>

    <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘oxygen’ ) ); ?>

    <?php wp_link_pages( array( ‘before’ => ‘<p class=”page-links”>’ . __( ‘Pages:’, ‘oxygen’ ), ‘after’ => ‘</p>’ ) ); ?>

    </div><!– .entry-content –>

    <?php echo apply_atomic_shortcode( ‘entry_meta’, ‘<div class=”entry-meta”>[entry-edit-link]</div>’ ); ?>

    <?php do_atomic( ‘close_entry’ ); // oxygen_close_entry ?>

    </div><!– .hentry –>

    <?php do_atomic( ‘after_entry’ ); // oxygen_after_entry ?>

    <?php do_atomic( ‘after_singular’ ); // oxygen_after_singular ?>

    <?php endwhile; ?>

    <?php endif; ?>

    </div><!– .hfeed –>

    <?php do_atomic( ‘close_content’ ); // oxygen_close_content ?>

    </div><!– #content –>

    <?php do_atomic( ‘after_content’ ); // oxygen_after_content ?>

    <?php get_footer(); // Loads the footer.php template. ?>`

    What can I change to eliminate the sidebar remnants that remain?

    #149992

    In reply to: Random Topic Link

    Robin W
    Moderator

    @robkk thanks for that, so to make this a topic I think you you would just change

    $posts = get_posts('post_type=post&orderby=rand&numberposts=1');
    

    to

    $posts = get_posts('post_type=bbp_get_topic_post_type()&orderby=rand&numberposts=1');

    although could be

    $posts = get_posts('post_type="bbp_get_topic_post_type()"&orderby=rand&numberposts=1');
    
    

    never sure of some of these without playing

    idk how to bring that link up in the menu

    For a ‘button’ (actually it would just be a link) you just paste it in text mode onto whtever page. in php, you just echo it

    echo '<a href="/?random=1">Random Post</a>' ;
    

    on a menu item, you just at it as a link dashboard>appearance>menus and look for links

    #149991

    In reply to: Full Width Forum Help

    Robin W
    Moderator

    sorry, sorry – missed that bit 🙂

    Ok will start typing again !

    in your bbpress.php

    change the lines that say

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

    to

    <div class=”bbpress-wrap”> 
    <div id=”bbpress-content”>
    
    

    Then go into

    wp-content/themes/oxygen/style.css

    and at the end of this file put

    .bbpress-wrap {
    width : 100% ;
    }
    #bbpress-content {
    float: left;
    margin: 0 0 30px;
    width : 100% ;
    }

    .bbpress #sidebar-secondary {
    display:none ;

    }

    What this does is get bbpress to use the bbpress-wrap with a width of 100% instead of content-wrap, as content-wrap is used by the other pages and need to be 67%.

    Then .bbpress #sidebar-secondary is set to display none, so that this disappears

    Now if that all works, it is possible that an upgrade of oxygen will take out these changes, so you really need to create a child theme and put both the bbpress.php and the style.css changes in there. See

    Functions files and child themes – explained !

    Do come back if that deosn’t all work, without the theme I can’t test here !

    #149990
    ssplwork
    Participant

    Do I password protect the page that the forum short code is on, or what? Password protecting the page does nothing. I’m running the Enfold theme by Kriesi.

    I need to make a set of users have access to the forums, and password protect everything inside of them, and certain people be able to edit, and all be able to post.

    #149989

    In reply to: Random Topic Link

    Robkk
    Moderator

    @robin-w, @joejozwowski

    i found the code to create a random post link that you can use as a reference , when creating a random topic link

    got it from http://cazue.com/articles/wordpress-create-a-random-post-button-2013

    add_action('init','random_post');
    function random_post() {
           global $wp;
           $wp->add_query_var('random');
           add_rewrite_rule('random/?$', 'index.php?random=1', 'top');
    }
     
    add_action('template_redirect','random_template');
    function random_template() {
           if (get_query_var('random') == 1) {
                   $posts = get_posts('post_type=post&orderby=rand&numberposts=1');
                   foreach($posts as $post) {
                           $link = get_permalink($post);
                   }
                   wp_redirect($link,307);
                   exit;
           }
    }

    link to show

    <a href="/?random=1">Random Post</a>

    creating a menu link , idk how to bring that link up in the menu

    #149987

    In reply to: Full Width Forum Help

    aussiestar14
    Participant

    Hey, I didn’t fix anything! The normal page http://www.curlyhorse.info/forum is working because I inserted a short code and choosed full width. The actual forum is still not working: http://www.curlyhorse.info/forum/ausbildung/
    We still need help!

    #149975
    GreedyMan
    Participant

    I created link to user’s profile by code:

    <?php
    	global $current_user;
    	 				get_currentuserinfo();
    	 				//echo '<pre>';
    	 				//print_r($current_user);
    	?>
    <ul class="hd-account">
    	<?php $first_name = $current_user->user_firstname; $last_name = $current_user->user_lastname;?>
    	<li><a href="<?php echo home_url().'/forums/profile/'.$current_user->user_login.'/'; ?>">Xin chào, <?php if ($first_name == '' || $last_name == '' ) echo $current_user->display_name; else echo $first_name.' '.$last_name; ?></a></li>
    	<li><a href="<?php echo wp_logout_url(home_url()); ?>">Thoát</a></li>
    </ul>

    I create this in theme’s header.php (not TwentyEleven …). Example, I have a link like that http://localhost/cars/forums/profile/namnguyen/. I click it and get an error “404 not found”, I don’t know why. Can someone help me?

    #149973
    Stephen Edgar
    Keymaster

    I have just had a quick look at this and with a fresh WordPress 3.9.1 install and bbPress 2.5.4 with define('FORCE_SSL_ADMIN', true); I cannot see an issue, everything works as expected using both WordPress’ ‘Lost Password’ (https://example.com/wp-login.php?action=lostpassword) or using the bbPress shortcode [bbp-lost-pass] on a page.

    I also went through using the bbPress login widget with custom pages for ‘lost-password’ and ‘register’ using both http:// and https:// as the URL’s in the Widget and again everything worked as expected.

    I’d any other plugins you may be using that change any of WordPress’ login/authentication to narrow down the issue.

    #149970
    Robkk
    Moderator

    However, even after enabling threaded replies, I’m still unable to achieve the same result with the nested reply. When I click “reply” in the top corner of the 4th post down, for example, it just scrolls to the initial reply form beneath the first post, instead of opening up a new reply form beneath the 4th post.

    i dont really know then it might be edited threaded replies to bring up the reply form, i checked there code and on the reply link has

    <a href="/topic/to-go-to-college-or-to-move-to-la-and-act/?bbp_reply_to=335515&_wpnonce=62ed053836#new-post" class="bbp-reply-to-link" onclick="return addReply.moveForm('post-335515','335515','new-reply-335513','335513');">Reply</a>

    most of this code is normal except i think

    onclick="return addReply.moveForm('post-335515','335515','new-reply-335513','335513');

    the 335515 is most likey the post id

    other than that i have no idea how to do this , but i mean if i find out in the future i will update this topic.

    If you figure it out in the future before me i would like you to update this topic.

    #149969
    MarximusMG
    Participant

    @robkk You rule, thanks for the help! Here’s a site I’m just using to mess around with these customizations on: http://revyved.com/forums/topic/just-stumbled-on-this/

    I was able to successfully move the reply form to beneath the first post in each topic, thanks to your suggestion to enable show lead topic, as well as moving the line of code in content-single-topic.

    However, even after enabling threaded replies, I’m still unable to achieve the same result with the nested reply. When I click “reply” in the top corner of the 4th post down, for example, it just scrolls to the initial reply form beneath the first post, instead of opening up a new reply form beneath the 4th post.

    #149965
    kopperwoman
    Participant

    I’m having a similar problem to dustinarmstrong. But its not exactly the same.

    I’m trying to fix a broken forum set up for a client. I did not do the forum installation (he did it himself) AND the forum is installed on a live site that gets lots of web traffic so I don’t want to do anything that might impact the website overall.

    Here’s my situation:
    1) BBPress was installed (I don’t have details about when and how),
    2) a page was created with the [bbp-forum-index] shortcode on it
    3) the forum didn’t work, so my client contacted me to fix it
    4) I went into settings > forums and changed the forum root slug from the default “forum” to “travel-forums” (the name of the page where the shortcode lives. The error message “Possible bbPress conflict: Forum slug” showed up next to the slug field after saving the settings.
    5) I also changed the single forum slug from the default “forum” to “travel-forums”. The error message “Possible bbPress conflict: Forums base” showed up next to the slug field after saving.

    In my case, the forum page DOES show up at http://foobar.com/travel-forums but it is empty except for the welcome text that I had entered into the forum main window. (So it just says “Welcome to our forum” without any of the discussion topics showing up.

    Also, I have the “Recent Topics” widget enabled on my sidebar and my three test discussion topics DO show up there. When I click on any of them they take me to the correct URL but the pages are blank. So, for example, when I click on “test topic” in the widget I land on http://foobar.com/travel-forums/topic/test-topic/ and the page displays the topic header “Test topic” and the topic question “what do you think about travel?” but it doesn’t display any of the posts.

    I’m not sure if this behavior is related to the slug conflict error messages or if something else is wrong.

    I’m trying to follow the advice that Stephen Edgar gave.

    First up, I think this is probably true in my case:

    most likely you have something else either titled or using the slug discuss and this includes any items in trash as even though they are in the trash they still reserve that slug and it is not released until the item is removed from the trash.

    This is probably a stupid question but How do I empty the trash to make sure that the old slug is removed?

    Second, I’d like to try this:

    To fix this try resetting your permalinks. In your WordPress Administration Screens navigate to Settings > Permalinks, select a different permalink structure and save. Then select your preferred permalink structure and save again.

    but since my website is live and has been for a long time (and has lots of blog posts using the custom structure already) I’m concerned that this could permanently break the existing links. Any thoughts on this?

    #149962
    Stephen Edgar
    Keymaster

    Awesome…

    (The ———– issue is typically login credentials expiring in WordPress between WordPress and MySQL)

    #149949
    Robin W
    Moderator

    which page from my theme does bbpress display using?

    Step by step guide to setting up a bbPress forum – Part 1

    your theme is a paid one, so I can’t just download and have a quick look.

    #149942
    Doug Smith
    Participant

    Thanks, Stephen. I was just about to update this conversation with the same thing now that I’ve had a chance to look through the code.

    I talked with @jjj about this at WordCamp Milwaukee and he suggested creating a Trac ticket for it, which I have done. https://bbpress.trac.wordpress.org/ticket/2668

    Robkk
    Moderator

    Do you know how I would go about hiding the “Create New Topic” form at the bottom of the page, now that I’ve made the link at the top to go to the “New Topic” standalone page?

    copy content-single-forum.php into your bbpress folder
    and delete any instance that say <?php bbp_get_template_part( 'form', 'topic' ); ?>

    that should do it

    #149936
    Robkk
    Moderator

    @marximusmg yeah this is pretty easy

    copy content-single-topic into your bbpress folder in your child theme.

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

    just below <?php bbp_get_template_part( 'content', 'single-topic-lead' ); ?>

    #149927
    Stephen Edgar
    Keymaster

    You can also use WordPress’ custom profile fields:

    https://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods

    And an example plugin here using the above method:

    https://gist.github.com/ntwb/c70caf5a0aa9d3062a6d

    #149922
    Stephen Edgar
    Keymaster

    Why not change the code back to what it was then?

    You should look up some CSS resources and use your browsers ‘inspector’ to look at how to make CSS changes to your theme, use your favourite search engine to find these.

    #149921
    Stephen Edgar
    Keymaster

    bbPress will use that forum.php file as a wrapper template for all of bbPress pages and that is most likely what the issue is.

    I’d suggest if you need a wrapper template to work with your theme you copy the contents of your themes page.php to a file named bbpress.php.

    Then copy any bbPress templates you want to customize to your themes folder.

    See these for more info on copying bbPress templates and child themes:

    Functions files and child themes – explained !


    https://codex.bbpress.org/theme-compatibility/

Viewing 25 results - 11,076 through 11,100 (of 32,504 total)
Skip to toolbar