Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,351 through 11,375 (of 32,504 total)
  • Author
    Search Results
  • #148986
    Leonyipa
    Participant

    yes, but it doesn’t work πŸ™

    I also found the code is in
    /public_html/wp-content/plugins/bbpress/templates/default/css/bbpress.css

    I directly change the number of

    #bbpress-forums div.bbp-topic-content img,
    #bbpress-forums div.bbp-reply-content img {
    max-width: 100%;
    }
    However, no matter what number I change to, it still doesn’t work.
    The width of the image still remain 100%

    #148984
    Robkk
    Moderator

    change the numbers to whatever you want

    #bbpress-forums div.bbp-reply-content img, #bbpress-forums div.bbp-topic-content img {
    max-width: 500px;
    max-height:250px;
    height: auto;
    }

    you add this into anywhere where you can have custom css

    in bbpress.css in your child theme(you copy the original in your child theme)
    in your child themes css stylesheet
    the jetpack plugin module custom css
    a standalone custom css plugin

    #148973

    In reply to: Simple Layout

    Robin W
    Moderator

    ok, several ways you could do this, the best I know is

    https://wordpress.org/plugins/display-posts-shortcode/

    just create a page called anything and put the code on it.

    you’ll be looking for a custom post type of topic.

    see https://github.com/billerickson/display-posts-shortcode/wiki for the arguments you can use

    you can then determine exactly what you display

    but something like

    [display-posts post_type=”topic” posts_per_page=”15″]

    would give a simple list of 15 clickable topic titles per page.

    #148961
    Stephen Edgar
    Keymaster

    Ooops, missed the 2.3.2 πŸ˜‰

    I should have said in my previous reply, any conflicting permalinks ‘except’ a page titled forums, indeed using a page titled forums with a shortcode should work just fine.

    As you have changed the slug on that conflicting page now could you try creating a new page forums and adding whatever shortcode your using to it, what happens?

    Note: I’m splitting this topic to it’s own also as this is a different issue from the original topic.

    #148959
    Robkk
    Moderator

    well you should change your sitewide hyperlink color because you want people to see links you post.

    for topics

    a.bbp-topic-permalink  {
    color:#222;
    } 

    for forums

    a.bbp-forum-title  {
    color:#222;
    } 
    #148958
    Paul
    Participant

    Hi Stephen, my upgrade was 2.3.2 to 2.5.4 not 2.5.3 to 2.5.3.

    You were correct, thank you. The problem was caused by a permalink conflict. The page I am using the shortcode had the slug forums. Changing the slug to something else so it was not the same as the slug used by Forum Root (or visa versa) resolved the issue.

    The question remains though, why is this a problem with this version of bbpress over the older version I was using?

    #148953
    Robkk
    Moderator

    ok this changes the style of all the links on your site so it is not white (i copied googles link color)

    a {
        color: #3a84df;
    }
    
    a:hover {
        color: #3a84df;
        text:decoration: underline;
    }

    you add this into anywhere where you can have custom css

    in your child themes css stylesheet
    the jetpack plugin module custom css
    a standalone custom css plugin

    #148951
    Robkk
    Moderator
    a {
        color: #676768;
    }

    try that

    Jerry
    Participant

    I have updated the code again, and I have a question to improve it a little. First the update; I had more trouble with formatting when I wanted to bring in topics from different sites. What I finally learned was to create a new id class and use it in my child theme style.css. Here is the updated code:

    add_shortcode( 'recent-bbpress-topics', 'recent_bbpress_topics' );
    
    // Add Recent Topics to BBPress from separate site within WP Multisite
    function recent_bbpress_topics($attr) {
    	//Switch to the blog where the bbpress topics are located
      switch_to_blog($attr['id']);
    
      //this, along with $response variable below, allows for display within content - without these, shortcode will display topics at top of content
      ob_start();
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 8 ) ) ) {
        //id class to be named "#recent-titles li.bbp-topic-title" and placed in style.css in the child theme ?>  
        <ul id="recent-titles">
          <?php while ( bbp_topics() ) : bbp_the_topic(); ?>
    			<?php bbp_get_template_part( 'loop', 'single-topic' ); ?>
    		  <?php endwhile; ?>
          <?php //bbp_get_template_part( 'loop', 'topics' ); ?>
        </ul>
        <?php //restore the current blog to maintain formatting 
        restore_current_blog();
        }
        //this, along with ob_start(); above, allows for display within content, instead of at the top of the content/page
        $response = ob_get_contents();
          ob_end_clean();
          return $response;
      }

    And here is what I added to style.css:

    /*Changes made to accommodate formatting for plugin recent-bbpress-changes*/
    #recent-titles li.bbp-topic-title {
    	float: left;
    	text-align: left;
    	width: 12%;
      overflow: hidden;
    }

    Notice how I declared the class id in the php code. One additional note; I have made several changes to my bbpress topics before I ever implemented this plugin. Perhaps other users will not require the css changes that I had to implement, post plugin activation.

    Now for my question: Is it possible to have two input parameters to a shortcode? For this plugin, I would like to be able to change the input to “post_parent” as well as “switch_to_blog($attr[‘id’]);”. I’ve already tried to do this, but have failed. Here is what I tried:

    function recent_bbpress_topics($attr,$attr2) {
    	//Switch to the blog where the bbpress topics are located
      switch_to_blog($attr['id']);
    
      //this, along with $response variable below, allows for display within content - without these, shortcode will display topics at top of content
      ob_start();
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => $attr2['id2'], 'posts_per_page' => 8 ) ) )

    I end up getting an illegal string swap error. Anyone got any ideas here?

    #148940

    In reply to: Theming Question

    Robin W
    Moderator
    #148938

    In reply to: Forum index

    Robkk
    Moderator

    i also forgot that buddypress uses a nav id of #subnav but thats easy to fix just change subnav to bbnav

    so all the code would be

    to register the menu

    function register_menu() {
    	register_nav_menu('bbmenu', __('bbpress Forum Menu'));
    }
    add_action('init', 'register_menu');

    place this below <?php do_action( 'bbp_template_before_forums_loop' ); ?>

    <nav id="bbnav" role="navigation">
    
    <?php
    if ( has_nav_menu( 'bbmenu' ) ) { /* if menu location 'bbmenu' exists then use custom menu */
          wp_nav_menu( array( 'theme_location' => 'bbmenu') ); 
    }
    ?>
    
    </nav>

    now add custom css

    #bbnav ul {
    	font-size: 13px;
    	list-style: none;
    	margin: 0;
    }
    
    #bbnav li {
    list-style-type: none;
    display: inline-block;
    margin: 6px 4px;
    }
    
    #bbnav a {
    text-decoration: none;
    color: #555;
    background: #ddd;
    padding: 2px 8px;
    border: 1px solid #e4e4e4;
    }
    
    #bbnav li a:hover {
    background: #333;
    color: #fff;
    border-color: transparent;
    text-shadow: none;
    }

    ok i found a css way of showing the menu only on the forum archive page

    create a page called forums that leads to the forum archive

    now make sure to grab the page id

    heres how to get the page id

    now add this css , replace (#) with the page number id for the forum archive page

    .post-# #bbnav {
    	background: none;
    	clear: both;
    	display: block;
    	float: left;
    	margin: 0 auto 6px;
    	width: 100%;
    }
    
    #bbnav {
    	display: none;  
    }
    

    now it should only show on the forum archive page only

    not in subscribed forums anymore

    if you dont see the menu , you probably need a special way to register menus for your theme

    #148935
    Robkk
    Moderator

    here use this code instead and remember put this into your functions.php in your child theme
    change the numbers to whatever you want

    add_filter('embed_defaults','themename_embed_defaults');
    function themename_embed_defaults($defaults) {
       $defaults['width']=500;
       $defaults['height']=250;
       return $defaults;
    }
    Robin W
    Moderator

    you shouldn’t be changing directly !

    can you come back and post your code for 2, you’ve just missed a “‘” somewhere I expect.

    #148931
    Robkk
    Moderator

    @leonyipa ok great on the youtube video width , at least the code is doing something

    there is probably another function on the web that i can direct you to if i find something that works on both height and width, so wait til i come back with a function that works for both

    if i give you a new function delete the old one

    paste codes into a child themes functions.php and style.css so that the code wont disappear during theme upgrades

    and dont edit the core files inside of bbpress
    copy those files into your child theme so you can be safe on bbpress plugin upgrades

    so copy bbpress.css to your child theme, if you dont have a child theme , make one they are great for customizing your bbpress install

    for more about customizing bbpress with css , plugins, and functions read this

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

    #148927

    In reply to: phpBB Import Error(s)

    Stephen Edgar
    Keymaster

    You wrote in your previous post:

    Sure thing, I’ll see what I can dig out. I’m going to be running the import a few more times over the coming weeks anyway because I need to make sure that I have the process down to a t before we decide to go live.

    Does this mean you have now gone live and a ‘few more imports’ has already happened and ‘coming weeks’ is time flies when having fun?

    You should find in your wp_postmeta table primarily two reference meta keys, _bbp_old_forum_id and _bbp_old_topic_id

    In the case below the new forum ID in wp_posts is 8789 for the old phpBB forum ID 53 and the new topic id in in wp_posts is 8803 for the old phpBB topic id 25743

    
    meta_id	post_id	meta_key	        meta_value	
    57514	8789	_bbp_old_forum_id	53
    57626	8803	_bbp_old_topic_id	25743
    

    With the above data in hand you should be able to map all your old phpBB forums and topic ID’s to the new bbPress forum and topic ID’s.

    Leonyipa
    Participant

    hi, sorry for the late reply.

    I tried both ways:

    1) changing the Participant role directly

    // Participant/Default
    case bbp_get_participant_role() :
    default :
    $caps = array(

    // Primary caps
    ‘spectate’ => true,
    ‘participate’ => true,

    // Forum caps
    ‘read_private_forums’ => true,

    // Topic caps
    ‘publish_topics’ => true,
    ‘edit_topics’ => true,
    ‘delete_topics’ => true,

    // Reply caps
    ‘publish_replies’ => true,
    ‘edit_replies’ => true,
    ‘delete_replies’ => true,

    // Topic tag caps
    ‘assign_topic_tags’ => true,
    );

    break;
    }

    after I changed it, nothing happened :/

    and
    2) making custom role, but it says:

    Parse error: syntax error, unexpected ‘roles’ (T_STRING), expecting ‘(‘ in /home/gleam/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 216

    
    216: function add_new roles( $bbp_roles )
    217: {
    #148924
    Leonyipa
    Participant

    I also found the code is in
    /public_html/wp-content/plugins/bbpress/templates/default/css/bbpress.css

    I directly change the number of

    #bbpress-forums div.bbp-topic-content img,
    #bbpress-forums div.bbp-reply-content img {
    max-width: 100%;
    }

    However, no matter what number I change to, it still doesn’t work.
    The width of the image still remain 100%

    #148923
    Leonyipa
    Participant

    Thanks very much @Robkk!!

    The youtube video worked!!! I have been looking for the solution for a long time, thanks!
    The maximum width of youtube video works really well!!

    However, when I change the code to height, it doesn’t work πŸ™

    Also for the image, I edited the css
    because I am using BBPress Default Theme, it doesn’t have a .css and tell me to edit function.php instead
    And I paste the code into: /public_html/wp-content/themes/bp-default/functions.php

    #bbpress-forums div.bbp-reply-content img, #bbpress-forums div.bbp-topic-content img {
    max-width: 100%;
    height: auto;
    }

    but no matter what I change the number, it is still set to 100%.
    Did I add the code to the wrong place? or it’s not working?

    #148914
    Stephen Edgar
    Keymaster

    @pplumridge I can’t see how any of the differences in code from 2.5.3 to 2.5.4 could have broken this.

    Any chance it’s a permalink conflict? Do you have any posts, pages, maybe even forums or topics using forums as the slug? (Also check the ‘trash’ folders to make sure the post/page isn’t there)

    #148909
    acornale
    Participant

    Correct. The forums are currently private. When I’m logged in, the feeds work fine but for non-logged in users, they see blank boxes.

    This is the code I’m using to display the latest 4 topics:

    <?php query_posts( array( ‘post_parent’ => ’89’, ‘post_type’ => ‘topic’, ‘posts_per_page’ => ‘4’, ‘order’ => ‘DESC’, ‘offset’ => ‘0’ ) );?>
    <?php if(have_posts()):while(have_posts()):the_post();?>

    <div class=”home-forum-single”>

    <span class=”entry-date”><?php echo get_the_date(); ?></span>
    <?php the_title();?>

    </div><!– end home forum single –>

    <?php endwhile;?>
    <?php endif;?>
    <?php wp_reset_query(); ?>

    There’s also a <?php the_permalink();?> wrapped around the title above but every time I enter it in the box, it converts it to a link so I’ve taken it out for now.

    Also, the “post_parent” in the query is the private forum.

    #148901
    Robin W
    Moderator
    #148898
    Stephen Edgar
    Keymaster

    The current phpBB importer only imports ‘extra’ user fields from the phpbb_users table.

    The following custom profile fields are what is currently imported, we store these in wp_usermeta

    
    		// Store ICQ (Stored in usermeta)
    			'from_fieldname' => 'user_icq',
    		// Store MSN (Stored in usermeta)
    			'from_fieldname' => 'user_msnm',
    		// Store Jabber
    			'from_fieldname' => 'user_jabber',
    		// Store Occupation (Stored in usermeta)
    			'from_fieldname' => 'user_occ',
    		// Store Interests (Stored in usermeta)
    			'from_fieldname' => 'user_interests',
    		// Store Signature (Stored in usermeta)
    			'from_fieldname' => 'user_sig',
    		// Store Location (Stored in usermeta)
    			'from_fieldname' => 'user_from',
    		// Store Avatar Filename (Stored in usermeta)
    			'from_fieldname' => 'user_avatar',
    

    The current implementation needs to explicitly named fields to import them, so having the import support custom named fields is not available to be used at this time, one day hopefully.

    With that said, with a list of fields names and the tables the fields are stored in these can easily be added to a customized phpBB importer.

    As to where to send these fields, if you are using BuddyPress, XProfile would be the ideal place to have these. Our importer doesn’t handle this though, again, maybe one day we can add something in BuddyPress to import ‘extra’ profile fields from bbPress. Probably the key thing here is we can get all your phpBB profile fields imported into wp_usermeta and then with a bit of MySQL these could be copied over to the BuddyPress XProfile table and everything would be awesome. πŸ™‚

    EDIT: As all I’ve been doing the past ~5 days is working on the importers we do actually store the old phpBB user_id so mapping the old users after an import back to the old phpBB database should also not be an issue once bbPress 2.6 is released πŸ™‚

    #148894
    Robin W
    Moderator

    I presume the forums are currently private?

    What code are you using to display the latest 4 topics

    Jerry
    Participant

    Hi Robin. I made another improvement and added some comments. I noticed that, no matter where I inserted the shortcode, the topics displayed at the top of the content. After some searching I learned why – functions need to return a string. So I found an easy wordpress solution. I also simplified the shortcode, and removed the add_action line at the bottom as it was not doing anything. Here is the updated code:

    add_shortcode( 'recent-bbpress-topics', 'recent_bbpress_topics' );
    
    // Add Recent Topics to BBPress from separate site within WP Multisite
    function recent_bbpress_topics($attr) {
        //Switch to the blog where the bbpress topics are located
        switch_to_blog($attr['id']);
        //this, along with $response variable below, allows for display within content - without these, shortcode will display topics at top of content
        ob_start();
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 9 ) ) ) { ?> 
          <?php bbp_get_template_part( 'bbpress/loop', 'topics' );
          //restore the current blog to maintain formatting
          restore_current_blog();
          }
          //this, along with ob_start(); above, allows for display within content, instead of at the top of the content/page
          $response = ob_get_contents();
            ob_end_clean();
            return $response;
    }
    #148891
    Robkk
    Moderator

    not sure but you probably have to set a max width for oembed embeds

    http://www.wpbeginner.com/wp-themes/how-to-set-oembed-max-width-in-wordpress-3-5-with-content_width/

    add the code to your functions.php in your child theme.

    change 600 to whatever number you want as the width, im sure you could copy the function to width to height and also do the height to.

    if the code doesnt work , look at the comments and try that user posted code. (i havent tried any of these codes so i dont know if they work really, if they dont just delete the function from your child functions.php)

    for images (using img quicktag) i think you can use css

    #bbpress-forums div.bbp-reply-content img, #bbpress-forums div.bbp-topic-content img {
    max-width: 100%;
    height: auto;
    }

    for images (posted by link using oembed , imgur , flickr picture, instagram picture) the oembed code that i linked to should do the same for these.

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