Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,751 through 9,775 (of 32,511 total)
  • Author
    Search Results
  • #156762
    Robkk
    Moderator

    @nishant2hit

    use this plugin instead and see if it works

    https://wordpress.org/plugins/bbpress-do-short-codes/

    #156743
    Robin W
    Moderator

    @cbsy lots of ways to achieve this – two below

    1. Look in

    Dashboard>settings>forums>Forum Root slug, and see what ‘forum root’ is set to

    The create a page with this name on it – so title the page this

    The in that page write whatever intro you want, and then put

    [bbp-forum-index] at the bottom of the content

    bbpress will then use this page as your forum root.

    2.

    Add the following to your functions file

    add_action ('bbp_template_before_forums_index' , 'my_intro' ) ;
    
    Function my_intro () {
    Echo '<div class="entry-content"> Here is my intro text. This is lots of writing to introduce the forums and make people read this stuff </div>' ;
    }
    
    

    Functions files and child themes – explained !

    If you hit prolems or need further help, just come back !

    #156740
    Robin W
    Moderator

    Try the following

    //adds login/logout to menu
    //filter to add login/logout to menu
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_login_link' );
    function my_nav_menu_login_link($menu) {
        //uncomment the next line if you only want login on bbpress pages
        //if(is_bbpress()) {
        if (is_user_logged_in()) {
            //set the $url on the next line to the page you want users to go back to when they logout
            $url = 'http://www.mysite.com/forums' ;
            $url2=wp_logout_url($url) ;
            $loginlink = '<li><a title="Logout" href="'.$url2.'">Logout</a></li>';
            }
        else {
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            //set $page on the next line = the permalink for your login page
            $page='login' ;
            $loginlink = '<li><a href="/'.$page.'/">Login</a></li>';
                    }
        //uncomment out the next lines if you only want login on bbpress pages
        //      }
        //  else {
        //  $loginlink="" ;
        //      }
            $menu = $menu . $loginlink;
            return $menu;
    }
    dingzj
    Participant

    I have bbpress properly set up, and it worked well, except when clicking the user’s profile page, there is no sidebar with logged-in widget.

    Actually the sidebar was under user’s profile page. See this image.
    https://c4.staticflickr.com/8/7549/16059375738_d3e7dc8e1c_z.jpg

    How to fix this?
    I checked the source code, looks like the user profile page don’t have a ‘.et_right_sidebar’ class for its ‘left-area’, seems I need to change its template page? How?

    I am still a beginner to understand template code. Any good resources to better understand WP codebase?

    However, other forum page or topic page are fine with sidebar, like this.
    https://c2.staticflickr.com/8/7498/16245113651_341d810976_z.jpg

    #156725
    se7en1216
    Participant

    So earlier, someone suggested doing the following:

    // Add the breadcrumb
    // $crumbs[] = '<a href="' . esc_url( $root_url ) . '">' . $r['root_text'] . '</a>';
    $crumbs[] = '<a href="/forum/">Forum</a>';

    Can I make a duplicate of the template.php to drop into my theme somewhere to make a similar change? This works, but I don’t like the idea of altering the main bbpress files.

    #156572
    Robin W
    Moderator

    easiest way would be to uncode my shortcode

    bbp additional shortcodes

    or just use the do_shortcode function within your code

    https://codex.wordpress.org/Function_Reference/do_shortcode

    #156708
    Nicolas Korobochkin
    Participant

    I’m sorry for few days of silence. My love in the USA, and I’m in Russia without the visa.


    @jeffacubed
    thank you for “спасибо”. I can publish the code. Also I can give you access to my private repo on Bitbucket.

    wp_signup_location – it’s the filter which returns the sign up page location (url) and WordPress redirect to this addres. So this address not using in wp-signup.php because you already on the signup page. Your example of grep result shows that this filter using in wp-login.php (this page have the signup link).

    My code
    All of this files a part of my mu-plugins for this project.

    Require necessary files — gist.github.com/korobochkin/06780b88118e35c3bfd1

    wp-signup.php — gist.github.com/korobochkin/9e4f9cd6502c4252d902 I use selena_network_signup_main function from this file on page-signup.php template in child theme.

    wp-activate.php — gist.github.com/korobochkin/765d0a5d4e028dc3001a I use selena_network_activation_page function from this file on page-activate.php template.

    And finally gist.github.com/korobochkin/a161718855b7784bfb10 file which sends notifications after you create an account and disable default WordPress notifications (return false at the end of the function). If you return true at the end of this function then user get 2 emails with different activation links:
    site.com/wp-activate.php?key=HASH
    site.com/activate/?key=HASH

    P. S. can’t post this reply with links (bbPress doesn’t allow post replies with links).

    #156707
    Nicolas Korobochkin
    Participant

    I’m sorry for few days of silence. My love in the USA, and I’m in Russia without the visa.


    @jeffacubed
    thank you for “спасибо”. I can publish the code. Also I can give you access to my private repo on Bitbucket.

    wp_signup_location – it’s the filter which returns the sign up page location (url) and WordPress redirect to this addres. So this address not using in wp-signup.php because you already on the signup page. Your example of grep result shows that this filter using in wp-login.php (this page have the signup link).

    Require necessary files https://gist.github.com/korobochkin/06780b88118e35c3bfd1

    wp-signup.php — https://gist.github.com/korobochkin/9e4f9cd6502c4252d902 I use selena_network_signup_main function from this file on page-signup.php template in child theme.

    wp-activate.php — https://gist.github.com/korobochkin/765d0a5d4e028dc3001a I use selena_network_activation_page function from this file on page-activate.php template.

    And finally https://gist.github.com/korobochkin/a161718855b7784bfb10 file which sends notifications after you create an account and disable default WordPress notifications (return false at the end of the function). If you return true and the end of this function then user get 2 emails with different activation links:
    site.com/wp-activate.php?key=HASH
    site.com/activate/?key=HASH

    #156705
    supremor
    Participant

    All the code can be viewed there.

    #156699
    se7en1216
    Participant

    This page is currently written as just a simple WordPress page with several shortcodes as listed below:

    General Discussions
    
    [bbp-single-forum id=3926]
    
    Guild Discussions
    
    [bbp-single-forum id=3924]
    
    Group Forums
    
    [bbp-single-forum id=10169]

    When changing the Settings to have /forums as the forum root page, it changes all of the above listed shortcodes visually to look like it was just duplicated over and over from the current /forums-root page. It loses all of the current forum IDs and they all turn into a general forum-index.

    This is why I can’t just swap it in the Setting menu for the forums, and the reason I want the current Forum breadcrumb to direct to /forums and not /forums-root.

    If you would like, take a look at the way it looks now, and I’ll switch it after so you can see what it is doing.

    #156696
    Robin W
    Moderator

    I’m sorry but I don’t understand what you mean.

    What shortcodes – where?

    You will need to either provide examples or explain further.

    Sorry, but I am trying to help you, but there are hundreds of ways to set up wordpress/bbpress so need clear issues to resolve eg it looks like this, it needs to look like this

    #156695
    se7en1216
    Participant

    If I change the page as you mentioned, all shortcodes for the http://forgebreaker.net/forums/ page are overwritten, and you end up with several copies of the forum-index shortcode instead.

    #156688
    supremor
    Participant

    The changelog says this:

    Don’t always put tags around titles, as this affects the title bar, too. If you want bolded titles on topics with unread posts, use gtf_topic_title()

    Would I just add this code to the css or php file?

    #156683

    In reply to: WordPress dashboard

    jsantana
    Participant

    Hi @Robkk where do I add this code?

    MLH78
    Participant

    Hi all,

    I need help for programming a little feature for my forum.
    I’m willing to pay some money, after a more detailed discussion of price.
    But this should be somewhat “easy” for a programmer used to bbpress/wordpress, as most code already exists.

    If interested:

    Please, have a look at this page:
    https://www.tradingview.com/widget
    (They supply this for free by the way)

    Look at the top widget/stock chart, and look at the code supplied on the same page underneath the chart.
    Also notice how you can enter the stock-symbol of choice, in the top left corner of the chart, to search in Teamviewers own database, to load a new chart.
    NOTE: This method (from the user interface) does apparently NOT change the “SYMBOL” in the code, as seen on the page above.
    – For the “widget” to show another symbol by default, you’ll have to enter it and click “Apply” on the left side, to update the code with a new default SYMBOL.
    Please try it out, to have a feeling how it works.

    Now my questions:

    Q1:
    Is it possible to embed this script, in the text-area for bbpress, and run its output “live” when a user edits a new post?
    It could be called and embedded into the text area, by clicking a “check-button” labeled “Graf” (‘Chart’ in Danish).
    (And removed again unchecking this button – of course)

    Q2:
    Is it possible for the user, to enter directly on the user interface of the widget, a new symbol, and post it (correct chart) together with the topic?
    It would maybe require that the Post-button would need to update the “SYMBOL”-line in the script code, with the symbol the user have chosen and fetched from Tradingviews database, while also posting it all…Like you would do with an WYSIWYG editor

    I hope I made myself somewhat understandable 🙂

    Thanks in advance !

    Best regards,
    Martin L. Hansen – Denmark.

    #156676
    SergioDev
    Participant

    Hi!

    I want to put tinyMCE in bbPress, I copied this code -> https://codex.bbpress.org/enable-visual-editor/ and it works good but I want to disable html tab and leaving only the visual tab.

    Is it possible without using css or javascript solutions?

    #156673
    nishant2hit
    Participant

    Hi there, I am using insert_php plugin with bbpress. I have already added [insert_php] as a shortcode to whitelisted shortcode list under ‘bbPress2 shortcode whitelist’s settings. But, I am still getting [insert_php] as text in replies. Please help me understand if I am missing something here?

    #156669
    Robkk
    Moderator

    I believe that wordpress support forums use bbpress, how can I add this “Add New” button to my bbpress forum

    they do , the bbpress standalone version

    suprisingly this button is not in here.

    wordpress.org use a customized version of bbPress just like this site ooes

    you can try something like this

    <?php if ( bbp_is_single_topic() ) : ?>
    
    <?php if ( is_user_logged_in() ) : ?>
    <a class="bbp-new-reply-button" href="#new-post">New Reply</a><li>
    <?php endif; ?>		
    	
    <?php endif; ?>

    place the code in loop-replies.php above the <li class="bbp-header">

    you can style the link like so with some CSS , place wherever you place custom CSS

    .bbp-new-reply-button {
        background:black;
        color:#fff;
        text-transform:uppercase;
        text-decoration:none;
    }
    #156667
    Robkk
    Moderator

    bbPress doesnt render shortcodes

    you will need to use a plugin like this

    https://wordpress.org/plugins/bbpress-do-short-codes/

    Note: by default, only users with the ability to publish bbPress forums will have their short codes parsed. This can be changed by passing a different capability via the pw_bbp_parse_shortcodes_cap filter.

    so by this note keymasters/moderators for sure can post shortcodes.

    #156666
    Robkk
    Moderator

    this plugin does this type of thing but you have to manually configure that part

    https://wordpress.org/plugins/bbpress-go-to-first-unread-post/changelog/

    you would have to copy the bbPress Recent Topics widget edit it/rename it and change where it renders the topic title to gtf_topic_title()

    #156660
    Robin W
    Moderator

    No that’s fine – do have a really large amount of topics/forums?

    I’ll take another look at the code

    #156652
    Robin W
    Moderator

    Hope you haven’t forgotten anything else !

    ok edit

    $last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
    			if ($last_active < strtotime( '-10 days') )
    				bbp_close_topic( $topic_id );
    
    

    to

    $topic_date = strtotime( get_post( $topic_id, 'post_date', true ) );
    $forum_id = bbp_get_topic_forum_id($topic_id);
    if ($topic_date < strtotime( '-10 days') && $forum_id == 210 )
    bbp_close_topic( $topic_id );
    

    the $forum_id == 210 needs the forum id of the forum you want to restrict.

    to find this, go into

    Dashboard>forums>all Forums and hover of edit of the forum you want – eg hover over edit ‘announcements’ and look in the bottom right of the screen. you’ll see the edit url that will include post=210 or whatever number.

    You’ll need to test that all the above works, and come back if you need further help

    #156650
    supremor
    Participant

    I have another question. I’m trying to add the log in and log out code into functions but I get the following error:

    Parse error: syntax error, unexpected ‘Logout’ (T_STRING) in /home/carfan6/public_html/wp-content/themes/sparkle-child/functions.php on line 33

    #156646
    Robin W
    Moderator

    no problem

    Alter the lines

    $last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
    if ($last_active < strtotime( '-10 days') )
    

    to

    $topic_date = strtotime( get_post( $topic_id, 'post_date', true ) );
    if ($topic_date < strtotime( '-10 days') )
    

    should do it

    #156645

    In reply to: Custom Forum Layout

    Robin W
    Moderator

    ok, I’ve added it to my shortcode plugin

    bbp additional shortcodes

    you will want :

    [display-forum-index forum= ‘2932, 2921′ breadcrumb=’no’ search=’no’]

    You can see how to set this in

    Dashboard>settings>shortcodes

Viewing 25 results - 9,751 through 9,775 (of 32,511 total)
Skip to toolbar