Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,751 through 3,775 (of 32,517 total)
  • Author
    Search Results
  • #200157

    In reply to: _oembed_ good or bad ?

    Barry
    Participant

    Hmm…well, I don’t think it’s anything nefarious.

    WordPress is testing to see if any URLs inside those posts point to content that can be embedded and—though in your case I’m guessing that mostly is not the case, because it sounds like the result is mostly {{unknown}}—it then caches the result of its tests for better efficiency.

    If you don’t need or want this, you can disable it. I haven’t needed to do this and so have not tried any of the following guides myself, but perhaps they’ll be useful to you:

    #200147

    In reply to: My Ugly Website

    cephalo
    Participant

    I figured it out with this:

    .sidebar-primary { background: #ffe6d1; }

    #200132

    In reply to: My Ugly Website

    Barry
    Participant

    There are a few ways you might tackle this, but custom CSS is often a nice way to go, both because it’s “safer” than custom PHP and because you can easily tweak it to achieve a better fit. Plus, most themes make this really easy: simply navigate to Appearance ‣ Customize ‣ Additional CSS and add your code 🙂

    /* Remove the titlebar area on forum archive pages */
    .bbpress.forum-archive #page-titlebar {
      display: none;
    }
    
    /* Retain some whitespace for consistency with other pages */
    .bbpress.forum-archive #site-content {
      margin-top: 75px;
    }

    In this case, perhaps some rules like I’ve listed above could be a nice starting point?

    #200039
    Clivesmith
    Participant

    Hi,
    I am trying to create a plugin for my own use, I think the problem is a coding one.

    I have copied some of this code from a plugin and added some myself to try to create my own plugin rather than adding it to my function.php file.

    1. I have added a new record in the postmeta table with the topic ID. meta key and meta value for every topic I have in the table.

    2. I want a meta box at the backend on both the topic and reply screens, in the metabox for both screens I want to show the meta value of the associated topic.
    I have done both these

    3. I would like to be able to change this value, but only in the topic screen.

    With the code below, if I change the value in the reply screen when I update nothing changes which is great, but if I change the value in the topic screen, when I update I get a blank value returned and the original value in the table is also removed.
    When I create a new topic I would also like to populate the meta table.

    */

    class bbPress_add_meta_fields {

    /**
    * Construct.
    */

    private $match_m_fields = array();
    public function __construct() {
    if ( is_admin() ) {
    add_action( ‘load-post.php’, array( $this, ‘init_metabox’ ) );
    add_action( ‘load-post-new.php’, array( $this, ‘init_metabox’ ) );
    $this->match_m_fields = array(‘topic’, ‘reply’);
    }
    }

    /**
    * Meta box initialization.
    */
    public function init_metabox() {
    add_action( ‘add_meta_boxes’, array( $this, ‘add_metabox’ ) );
    add_action( ‘save_post’, array( $this, ‘save_metabox’ ), 10, 2 );
    }

    /**
    * Adds the meta box.
    */
    public function add_metabox() {
    add_meta_box(
    ‘bbp_m_field_metabox’,
    __(‘Twitter name’, ‘textdomain’ ),
    array( $this, ‘render_metabox’ ),
    ‘topic’, ‘side’, ‘high’
    );
    add_meta_box(
    ‘bbp_m_field_metabox’,
    __( ‘Twitter name’, ‘textdomain’ ),
    array( $this, ‘render_metabox’ ),
    ‘reply’, ‘side’, ‘high’
    );

    }

    /**
    * Renders the meta box.
    */
    public function render_metabox( $post ) {
    // Add nonce for security and authentication.
    wp_nonce_field( ‘custom_nonce_action’, ‘custom_nonce’ );

    // get the topic id
    $post_id = get_the_ID();
    $reply_topic_id = bbp_get_reply_topic_id( $post_id );
    // get value from table
    $twitval = get_post_meta( $reply_topic_id, ‘bbp_twitname’, true );
    echo $twitval;
    echo ‘<br><label for=”bbp_twitname”>Twitter Name</label><br>’;
    echo ‘<input type=”text” name = “bbp_twitname” value= “‘ . $twitval .’”>’;
    //echo ‘<input type=”submit” value=”Submit” />’;

    add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 2 );
    add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 2 );

    function bbp_save_extra_fields($reply_topic_id,$twitval) {
    if (isset($_POST) && $_POST[‘bbp_twitname’]!=”)
    update_post_meta( $reply_topic_id, ‘bbp_twitname’, $twitval );
    }
    }

    /**
    * Handles saving the meta box.
    *
    * @param int $reply_topic_id Post ID.
    * @param WP_Post $post Post object.
    * @return null
    */

    public function save_metabox( $reply_topic_id) {
    // Add nonce for security and authentication.
    $nonce_name = isset( $_POST[‘custom_nonce’] ) ? $_POST[‘custom_nonce’] :”;
    $nonce_action = ‘custom_nonce_action’;

    // Check if nonce is set.
    if ( ! isset( $nonce_name ) ) {
    return;
    }

    // Check if nonce is valid.
    if ( ! wp_verify_nonce( $nonce_name, $nonce_action ) ) {
    return;
    }

    // Check if user has permissions to save data.
    if ( ! current_user_can( ‘edit_post’, $reply_topic_id ) ) {
    return;
    }

    // Check if not an autosave.
    if ( wp_is_post_autosave( $reply_topic_id ) ) {
    return;
    }

    // Check if not a revision.
    if ( wp_is_post_revision( $reply_topic_id ) ) {
    return;
    }

    // Check to match the slug
    if(!in_array($post->post_type, $this->match_m_fields)){
    // return;
    }

    $meta_box_text_value = $twitval;

    if(isset($_POST[“bbp_twitname”])) {
    $meta_box_text_value = $_POST[“bbp_twitname”];
    }

    update_post_meta($reply_topic_id, ‘bbp_twitname’, $twitval);
    }

    /**
    * is_edit_page
    * function to check if the current page is a post edit page
    */

    public function is_edit_page($new_edit = null){
    global $pagenow;
    //make sure we are on the backend
    if (!is_admin()) return false;
    if($new_edit == “edit”)
    return in_array( $pagenow, array( ‘post.php’, ) );
    elseif($new_edit == “new”) //check for new post page
    return in_array( $pagenow, array( ‘post-new.php’ ) );
    else //check for either new or edit
    return in_array( $pagenow, array( ‘post.php’, ‘post-new.php’ ) );
    }

    }

    new bbPress_add_meta_fields();

    #199997
    Gregg
    Participant

    Why would the short code for latest topics display the topics for some users but not for others?

    Non-logged in users and subscriber/participant levels cannot see the Topics on the page where the shortcode is used – yet they can see everything fine when they go the actual Forums.

    But I as admin can see the Topics fine when I visit the page where the shortcode is used.

    WordPress 5.1.1
    bbPress 2.5.14

    #199977

    In reply to: Noindex Search Pages

    budget101
    Participant

    Edit your Robots.txt file and add the following:

    User-agent: *
    Disallow: /search?*
    Disallow: /search/*
    #199948
    chickencurry
    Participant

    I use a widget on my bbpress forum site for recent topis. It’s the standard bbpress widget. Before the topic title are 7 speech bubbles. I don’t know if it’s always seven, but it doesn’t look good and it has no real use. Can I change this to a emoji symbol, like fire, and maybe the number of replies to it? How can I find the right code?

    #199944
    delikatesy
    Participant

    I’d like to show the newest topics, but only the ones, which have more than 3 replies. I haven’t found a shortcode or a filter for this, is it possible to set this up somehow?

    thanks

    #199934
    bsym
    Participant

    this code but not related to the article.

    `<?php $topics_post = array(‘post_type’ => bbp_get_topic_post_type(), ‘posts_per_page’ => 2);

    ?>
    <?php $widget_query = new WP_Query($topics_post); ?>
    <?php while ($widget_query->have_posts()) :
    $widget_query->the_post();
    $topic_id = bbp_get_topic_id($widget_query->post->ID);
    ?>

    <div class=”col-12 col-md-6″>
    <div class=”pr9-cards”>
    <div class=”pr9-cards–img pr9-supergraphicimg pr9-related-card”>
    ” title=”<?php bbp_topic_title($topic_id); ?>”><?php bbp_topic_title($topic_id); ?>
    <p class=”pr9-bbp-detail”><?php bbp_topic_excerpt($topic_id); ?></p>
    <p class=”pr9-bbp-author”>by <?php bbp_author_link(array(‘post_id’ => 1, ‘size’ => 100)); ?></p>
    <!– <span class=”reply”><?php bbp_forum_reply_count(); ?> reply count</span>
    <span class=”reply-date”><?php bbp_reply_post_date(0, true); ?></span> –>
    <br>
    “>More Detail

    </div>
    </div>
    </div>
    <?php endwhile; ?>’

    #199927
    chickencurry
    Participant

    Hello bbPress team and users

    I am currently setting up my first bbpress forum. I am using buddypress and gamipress (didnt set it up so far) too.

    I use a widget on my bbpress forum site for recent topis. It’s the standard bbpress widget. Before the topic title are 7 speech bubbles. I don’t know if it’s always seven, but it doesn’t look good and it has no real use. Can I change this to a emoji symbol, like fire, and maybe the number of replies to it? How can I find the right code?

    Another question somebody could maybe anwser. Can I show gamipress ranks and points below the avatar in postings or other informations from buddypress profiles, or any bbpress related informations?

    Thank you in advance and have a nice day to the whole in community!

    #199905
    nfusionco
    Participant

    Here is the value in my _bbp_converter_query string so you can see right where the issue is happening each time I believe.

    SELECT value_id, meta_value FROM lT8Kj0L7_bbp_converter_translator WHERE meta_key = '_bbp_old_forum_id' AND meta_value = '40' LIMIT 1

    Clicking Pause & Start never continues on and instead imports the same 27 topics it did previously each time you pause and start growing topics by 27 over and over.

    #199904
    nfusionco
    Participant

    Continuing the troubleshooting here in case someone has an idea. Upgraded vBulletin to 4.2.5; can’t access the site directly anymore but the database is still fine. Tried to do the bbPress import once more fresh and it hangs still at “Doing Step 6” with No forum subscriptions to import. The debug is a little differnt now though:

    [13-Apr-2019 02:09:24 UTC] PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php on line 225
    [13-Apr-2019 02:09:24 UTC] PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php on line 237
    [13-Apr-2019 02:09:24 UTC] PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php on line 241
    [13-Apr-2019 02:09:25 UTC] PHP Fatal error:  Uncaught Error: Cannot pass parameter 1 by reference in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php:1485
    Stack trace:
    #0 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(1508): BBCode->Internal_GenerateOutput(1)
    #1 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(1891): BBCode->Internal_RewindToClass(Array)
    #2 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(2068): BBCode->Internal_ParseStartTagToken()
    #3 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/classes/class-bbp-converter-base.php(1211): BBCode->Parse('[list=1][*]quee...')
    #4 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/converters/vBulletin.php(754): BBP_Converter_Base->callback_html('[list=1][*]quee...')
    #5 /var/www/vhosts/mydomain.com/dev.mydomain.com/w in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php on line 1485
    #199903
    nfusionco
    Participant

    Debug log included:

    [12-Apr-2019 22:13:19 UTC] PHP Fatal error:  Uncaught Error: Cannot pass parameter 1 by reference in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php:1485
    Stack trace:
    #0 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(1508): BBCode->Internal_GenerateOutput(1)
    #1 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(1891): BBCode->Internal_RewindToClass(Array)
    #2 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php(2068): BBCode->Internal_ParseStartTagToken()
    #3 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/classes/class-bbp-converter-base.php(1211): BBCode->Parse('[list=1][*]quee...')
    #4 /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/converters/vBulletin3.php(752): BBP_Converter_Base->callback_html('[list=1][*]quee...')
    #5 /var/www/vhosts/mydomain.com/dev.mydomain.com/ in /var/www/vhosts/mydomain.com/dev.mydomain.com/wp-content/plugins/bbpress/includes/admin/parser.php on line 1485
    #199902
    nfusionco
    Participant

    Installed bbPress (2.7RC) to test and I like the improved dashboard for information but still having the import issue – though now I’m informed that it reaches step 6:

    Step 6. No forum subscriptions to import
    and just doesn’t move past that point. As a note there are no other plugins activated at all in my wordpress install – this is brand new and i’m starting out with the bbPress plugin since it’s the largest potential issue.

    nfusionco
    Participant

    I’m trying to import an old vBulletin (3.8.3) forum to a new bbPress (2.5.14) setupon WordPress 5.1.1 and the initial import looks great. It imports the users (~13k) says something about deleting their WordPress password, then a moment later it seems to hang and no matter how long I leave it we never progress.

    Calculating forum hierarchy (0 - 99)
    Converting forums (0 - 99)
    Delete users WordPress default passwords (12700 - 12799)
    Delete users WordPress default passwords (12600 - 12699)
    Delete users WordPress default passwords (12500 - 12599)
    Delete users WordPress default passwords (12400 - 12499)
    Delete users WordPress default passwords (12300 - 12399)

    Looking at the forum sections shows that it’s created the 22 forums and correctly set some of them as categories, they also show how many topics and replies are in each one correctly –

    — Random Thoughts - Topics: 3,119 Replies: 54,698

    But only 27 topics across the entire forum are imported. It’s the same 27 topics every time as well. To the point that if I stop the import, and hit the start button again, it imports these same 27 topics once more now showing 54. Is there an error log I can find that might show me why it’s hanging up? The bit above with the Calculating Hierarchy is the last update I ever get in the window. I added the lines to turn on debug logging in WordPress but nothing every shows up.

    define( 'WP_DEBUG', true ); // turn on debug mode
    if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    	define( 'WP_DEBUG_LOG', true ); // log to wp-content/debug.log
    }
    #199889
    lflier
    Participant

    Late to the party, but instructions for enabling the TinyMCE editor are here. Instructions for styling the content inside the editor are here. TinyMCE is not Gutenberg. But it’s simple and reasonably user-friendly.

    #199887
    lflier
    Participant

    One of the problems I’ve encountered in trying to use the TinyMCE editor in bbPress is styling the text inside the editor itself. The default fonts are serif, but suppose you want sans?

    Attempting to override the font-family in the usual way — by modifying your theme’s CSS file — fails because the editor window of TinyMCE is in it’s own tiny little world as far as CSS is concerned.

    In order to get TinyMCE to use your own stylesheet, you have to pass it as an argument when the editor is called. Here’s how to do it in bbPress.

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = array( 
                'content_css' => '/wp-content/themes/mytheme/css/tinymce-editor.css',
            );
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    In the example above, “tinymce-editor.css” is the CSS file you want the editor to use. It is located in a folder entitled “CSS”, which is located in your theme folder “mytheme”. The code above can be copied and pasted into your functions.php file.

    Other options for the editor can be found here. Notice that the value for “tinymce” can be an array. That’s what we’re doing above.

    Additional arguments to pass in the array for the TinyMCE editor can be found here.

    I hope this helps someone. The documentation for styling the editor text could be improved. I banged my head on this problem for years until I stumbled on the solution elsewhere.

    #199882
    Robin W
    Moderator

    bbpress does not have fixed separators – it has default ones.

    you can change simply by putting this in your child theme functions file or using code snippets plugin

    function custom_bbp_sub_forum_list() {
      $args['separator'] = 'whatever you want' ;
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );
    

    You also seem to be confused by templates. Theme and plugin templates are exactly that and designed to be changed if wanted. With bbpress you simply follow

    Step by step guide to setting up a bbPress forum – part 3

    #199866
    tapiohuuhaa
    Participant

    I had problems with fixed separators in source. I edited the core code, but is there any other way?
    See my changes here:

    Get rid of fixed separators

    #199828
    atcreat
    Participant

    I created a site using buddypress. The shortcodes like [bbp-login], [bbp-register], [bbp-lost-pass] not working. It just shows the shortcode. I tested it with the theme Twenty Seventeen and NO other plugin installed. WordPress 5.1.1, PHP 7.3 (tested also with 5.6 and 7.2), and Buddypress 4.2.0.
    You can see it here: https://bbpress.at-creation.ch/login/
    Thanks for your help.

    #199772
    ckriegel
    Participant

    Hi, i met this issue, and for future ppl who would face the same problem, here is a simple fix that worked for me : http://zzlatev.com/bbpress-404-header-in-users-profiles/

    it’s an issue with 404 being catched and not letting bbpress show the profile page, evenif it exists. You can add this in the theme function file :

    function bbp_fix_users_404_headers() {
        if ( ! function_exists( 'bbpress' ) ) return;       
        $bbp = bbpress();
    
        if ( !empty( $bbp->displayed_user ) && is_404() ) {
            global $wp_query;
            $wp_query->is_404 = false;
            status_header( 200 );
        }
    }
    add_action( 'wp', 'bbp_fix_users_404_headers' );
    budget101
    Participant

    @lucio – I had the same issue, I wanted my topic list to appear above my subforums, here is the easy fix.

    go to> wp-content>plugins>bbpress>templates>default>bbpress

    Find content-single-forum.php

    select lines 28-32:

    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>

    Find these lines:

    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>

    Paste the 3 lines selected above UNDERNEATH those lines (Line #50)

    #199767
    Robin W
    Moderator

    ok, that is beyond free help, but in essence you’ll need to amend templates for

    loop-single-forum
    loop-single-topics

    see

    Step by step guide to setting up a bbPress forum – part 3

    item 3

    #199690

    In reply to: larger font size

    Robin W
    Moderator
    div.bbp-template-notice p {
    	font-size: 12px !important;
    }
    #199679
    Ruchik
    Participant

    Hey ,I have this same issue of the shortcode.

    Thank you for helping me out.It will be very helpful for my new project.

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