Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,776 through 8,800 (of 32,505 total)
  • Author
    Search Results
  • #162075
    Antipole
    Participant

    I am trying your bbl-style-pack plugin, as that would be easier for others to maintain should that situation arise.

    The Remove Private option removes both occurrences of the PRIVATE: prefix. It also removes private forums entirely from the (bbPress) Forums List widget display when on an ordinary page (not just the prefix PRIVATE:) – but not when displaying a forum list. I suspect that this is not what was intended.

    [Incidentally, the bbpStyle pack Forum Display tab has a minor typo in section 4. The tick box reads Move subscribe to rightRemove private prefix rather than Remove private prefix

    What I want to achieve is to remove one occurrence of the duplicate wording in the forum display heading PRIVATE: PRIVATE: forum name. Are you able to suggest a solution for this?

    Regarding the Oh bother! No topics were found here!, yes creating a topic would remove this, but I have created empty forums to guide users as to which forum to use for their potential topic. It would be nice to lose that message when you are next in that code.

    thanks again

    #162073
    Robin W
    Moderator

    You can remove ‘private’ by adding the following to your functions file

    add_filter('protected_title_format', 'ntwb_remove_protected_title');
    function ntwb_remove_protected_title($title) {
    	return '%s';
    }
     
    add_filter('private_title_format', 'ntwb_remove_private_title');
    function ntwb_remove_private_title($title) {
    	return '%s';
    }
    

    or if you are not into coding, use my plugin
    https://wordpress.org/plugins/bbp-style-pack/

    which has the ability to remove it.

    If the forum is empty, a blue box correctly says This forum is empty but then a yellow box says Oh bother! No topics were found here!

    This will obviously only show until one topic is created, so is very temporary. I could work out some code to remove it, but maybe just create a topic and it will disappear !

    #162072
    Antipole
    Participant

    Robin… before I got your suggestion regarding rewrite rules, I had begun to suspect corruption of permissions in my forum database entires. I created a new test forum and it worked OK.

    So, for each empty forum I deleted it and created a new one. For each forum with topics, I created a new one, i.e. Forum A new, reassigned the topics from Forum A to Forum A new, deleted Forum A and then renamed Formum A new to Forum A.

    This has cleared my problem and I can now view the forum topics as Testuser2.

    How the problem arose, I do not know. There have been WordPress or bbPress updates recently and possibly something did not upgrade properly.

    There remain two issues:
    The keyword PRIVATE: is shown twice in the display of the forum contents.
    If the forum is empty, a blue box correctly says This forum is empty but then a yellow box says Oh bother! No topics were found here!

    In the latter case, I suspect a coding error whereby the empty forum is spotted but the code still tries to display the topics.

    Do I still need to reset my permalink as you suggest?

    Meanwhile I shall start re-instating my plugins etc.

    thanks for your support.

    Robin W
    Moderator
    Robin W
    Moderator

    ok, so 3 stages

    1. create the style.css entries – say you have a forum called ‘fred’ you might want to create a ‘fred’ style and have content for this eg

    .fred #fixed-background { background: url(‘http://www.mysite.com/wp-content/uploads/2015/02/fredbackground.jpg’); }

    2. look up the forum’s ID

    go to dashboard>forums>all forums and hover over the ‘edit’

    at the bottom of the screen you’ll see

    http://www.mysite.com/wp-admin/post.php?post=2921&action=edit

    in this case 2921 is the forum ID

    3. add the style to the body class for that forum

    Add this into your functions file

    function rew_add_class ($classes, $bbp_classes, $wp_classes, $custom_classes ) {
    	//the above line pulls in the pre-existing values so we don't lose them - ie run this function using this existing $variables if they exist
    	//then we check is this is a forum using a bbpress function
    	if ( bbp_is_single_forum() ) {
    	$bbp_forum_id = bbp_get_forum_id();
    	if ($bbp_forum_id == 2922) $custom_classes[] = 'fred' ;
    	if ($bbp_forum_id == 2923) $custom_classes[] = 'george' ;
    }
    
    	//then we check is this is a topic using a bbpress function
    	if ( bbp_is_single_topic() ) {
    	//and if so look up the forum id of that topic
    	$bbp_forum_id = bbp_get_topic_forum_id();
    	//now you will need to add lines for each forum you have and say which class class you want to use, these are just example lines.  Add one for each forum
    	//the number is the 'page_id' (actually it's the post id !)
    	if ($bbp_forum_id == 2922) $custom_classes[] = 'fred' ;
    	if ($bbp_forum_id == 2923) $custom_classes[] = 'george' ;
    		}
    	//then this gets merges into the existing wordpress and bbpress classes
    	$classes = array_merge (  (array) $classes, (array) $custom_classes ) ;
    	Return apply_filters( 'rew_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ) ;
    }
    
    add_filter ('bbp_body_class' , 'rew_add_class') ; 
    
    
    #162062
    Robkk
    Moderator

    install this plugin

    https://wordpress.org/plugins/bbpress-genesis-extend/

    try this CSS

    #bbpress-forums .bbp-reply-content p,
    #bbpress-forums .bbp-breadcrumb p {
    font-size: 15px;
    }
    #162059
    Robkk
    Moderator

    try this CSS instead.

    #bbpress-forums .keymaster div.bbp-topic-content, 
    #bbpress-forums .keymaster div.bbp-reply-content,
    #bbpress-forums .moderator div.bbp-topic-content, 
    #bbpress-forums .moderator div.bbp-reply-content {
    background: #f8f8f8 url(images/team-member.png) top right no-repeat;
    }
    #162055
    Robkk
    Moderator

    This should get a quite a few of the users names and turn them uppercase.

    add this custom css where you can put custom css like in your child themes stylesheet or a custom css plugin.

    a.bbp-author-name {
        text-transform: uppercase;
    }
    #162053

    In reply to: Footnotes

    Robkk
    Moderator

    if you are just using the shortcode , bbPress doesnt allow shortcodes for security reasons like users pasting the [bbp-login] shortcode

    since i assume this is just for admins you can use this plugin to use the shortcode.

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

    #162052
    Robkk
    Moderator

    alright but by default it does show.

    in the default file of loop-single-reply.php

    you will see this

    <div class="bbp-reply-author">
    
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    
    		<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>
    
    		<?php if ( bbp_is_user_keymaster() ) : ?>
    
    			<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
    
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    
    		<?php endif; ?>
    
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    
    	</div><!-- .bbp-reply-author -->

    this is the code that shows it , hence the show role = true

    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>

    #162051
    Robkk
    Moderator

    add this to your child theme functions.php or a functionality plugin.

    function rk_top_five_view() {
    bbp_register_view( 'top-five', __( '5 Most Popular Topics' ), array( 
        'meta_key' => '_bbp_reply_count',
        'posts_per_page' => '5' ,
        ' max_num_pages' => '1', 
        'orderby' => 'meta_value_num' ),
    false );
    }
    
    add_action( 'bbp_register_views', 'rk_top_five_view' );

    and then add this to your page.

    [bbp-single-view id="top-five"]

    #162049
    Robkk
    Moderator

    try this CSS

    .bbpress #content-area ul li, 
    .bbpress #content-area ol li {
      margin-left: auto;
    }
    #162047
    Robkk
    Moderator

    you would need to do something like this.

    Since it is hard to guess what your menu’s theme location is , i just put primary.

    This does work in some default themes like Twentyfourteen though.

    add_filter('wp_nav_menu_items','rk_bbp_menu_profile_link', 10, 2);
    function rk_bbp_menu_profile_link( $items, $args ) {
        if( is_user_logged_in() && $args->theme_location == 'primary')  {
    		
    	$current_user = wp_get_current_user();
            $user = $current_user->user_login ;
    	$profilelink = '<a href="/forums/users/' . $user . '/edit">Edit Profile</a>';
            $items .=  '<li>' . $profilelink .  '</li>';
    
    	}
        return $items;
    }
    #162042
    Robin W
    Moderator

    I can’t see that you implemented this code – is it still there?

    #162040
    Sebastian
    Participant

    Hi,

    Is used the code snippet from the codex and it worked fine.

    How could I modify the code to choose a specific menu?

    E.g. primary oder secondary. Actually “Edit Profil” is shown in all my menues and I just want to have it on my Primary Menu.

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {
        if (!is_user_logged_in())
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
     
    }

    Layout and functionality – Examples you can use

    Thanks!

    #162035
    vpontin
    Participant

    SOLVED
    I just put another add_action and seems to work fine:
    add_action( 'wp_print_footer_scripts', 'generico_quicktags' );

    #162033
    dc4x_admin
    Participant

    hii,

    I used this shortcode to see the table with most popular topics on my homepage:
    [bbp-single-view id="popular"]

    the problem is that when user add topics the table get’s longer.
    how can I limit the table rows?

    thank

    #162031
    vpontin
    Participant

    Hi all!
    Its a pretty noob question, but i didn’t find anything related to my issue…

    I added a quicktag to the wordpress default editor


    function generico_quicktags() {

    if ( wp_script_is( 'quicktags' ) ) {
    ?>
    <script type="text/javascript">
    QTags.addButton(
    'pov_generico',
    'POV (Genérico)',
    '[pov-generico]',
    '[/pov-generico]'
    );
    QTags.addButton( 'pov_generico', 'p', '<p class="fala generico">', '</p>', '', 'Fala (Personagem Genérico)', 10 );
    </script>
    <?php
    }

    }
    add_action( 'admin_print_footer_scripts', 'generico_quicktags' );

    But this don’t show in bbpress reply editor. How can i add this there too?

    #162026
    tarnvogL
    Participant

    @robkk for me it doesn’t :/
    any suggestions why?

    I have found the solution. I pasted the code from NickMackz into the area of the IP adress, which was only visible for admins.

    Robin W
    Moderator

    it could be done with code, suggest http://jobs.wordpress.net/ if you dontl have the skills, come back if you have good php, and I’ll point you at a file.

    #162015
    Robin W
    Moderator

    try adding

    # bbpress-forums content-area ul li {
    margin-left: 0px !important;
    }

    to your child theme style.css

    Functions files and child themes – explained !

    #162006
    Robin W
    Moderator

    yes use the shortcode

    [bsp-display-topic-index]

    available in

    https://wordpress.org/plugins/bbp-style-pack/

    once activated see settings>bbp style pack> shortcodes for a full explanation of how to use this

    VeeLow
    Participant

    I added some css in the custom css plugin, in order to get my bbpress forums full-width (drawing the code from an example in these forums). Success! or so I thought.

    But not quite. Now, the “members” pages associated with the pulldown menus at the upper right are “too long”–text entry/text display boxes run over into the space of my right content sidebar. When I deactivate the css plugin, my problem goes away.

    (WP 4.2.2, bbpress 2.5.7, Buddypress 2.2.3.1; theme is TwentyFourteen; I was able to see the same problem previewing 2013.)

    Here’s the css in question:

    .site,
    .site-header {
    	max-width: 100%;
    }
    
    .bbpress-forums .col-2cl .main {
    	background: none repeat-y right 0;
    	padding-right: 0;
    }
    
    .site-content .entry-header,
    .site-content .entry-content,
    .site-content .entry-summary,
    .site-content .entry-meta, 
    .page-content {
    	max-width: 100%;
    }
    
    .form-allowed-tags {
    	display: none;
    }
    
    div.bbp-breadcrumb, 
    div.bbp-topic-tags {
    	font-size: inherit !important;
    }
    
    #bbpress-forums ul.bbp-lead-topic, 
    #bbpress-forums ul.bbp-topics, 
    #bbpress-forums ul.bbp-forums, 
    #bbpress-forums ul.bbp-replies, 
    #bbpress-forums ul.bbp-search-results {
    	font-size: inherit !important;
    }
    
    #bbpress-forums {
    	font-size: inherit !important;
    }
    
    .bbpress .hentry {
    	margin: 0 auto 48px;
    	max-width: 100%;
    }
    
    @media screen and (min-width: 1008px) {
    	.bbpress .site-content {
    		margin-right: 0;
    		margin-left: 182px;
    	}
    }
    
    @media screen and (min-width: 1080px) {
    	.bbpress .site-content {
    		margin-left: 222px;
    	}
    }
    
    @media screen and (min-width: 1218px) {
    	.bbpress .site-content .entry-content {
    		margin-right: 0;
    	}
    }
    
    @media screen and (min-width: 673px) {
    	.bbpress .site-content {
    		margin-right: 0;
    	}
    }

    Can anyone help? I’d love to keep the full-width forum pages, but if it messes up the member pages, it’s a deal breaker…

    crzyhrse
    Participant

    And a year later I must add my thanks- I also have been able to use all this so that it works nicely, including the additional location field and with both website and/or location showing in the profile only if it is filled in…

    Getting the location to show in the profile properly took a little more than the changes Steven mentions making to Robin’s code… For anyone else who might come this way here is all of it put together…

    /* Add Location field to bbPress user profile page.
     */
    function ntwb_user_contact_methods_location( $user_contact ){
    
    	/* Add user contact methods */
    	$user_contact['location'] = __('Location');
    
    	return $user_contact;
    }
    add_filter('user_contactmethods', 'ntwb_user_contact_methods_location');
    
    /* Show Location in bbPress user profile.
     */
    function user_profile_bbp_location_information()	{
    //this function adds the location to the profile display menu
    	$location=bbp_get_displayed_user_field( 'location' ) ;
    	if ( ! empty($location) ) {
    		$label1 =  $rpi_options['item1_label'] ;
    		echo "<p>" ;
    		printf ( __( 'Location : ', 'bbpress' ));
    		echo $location;
    		echo"</p>" ;
    	}
    }
    add_action ('bbp_template_after_user_profile', 'user_profile_bbp_location_information') ;
    
    /* Show website in bbPress user profile.
     */
    function user_profile_bbp_website_information()	{
    //this function adds the website to the profile display menu
    	$url=bbp_get_displayed_user_field( 'user_url' ) ;
    	if ( ! empty($url) ) {
    		$label1 =  $rpi_options['item1_label'] ;
    		echo "<p>" ;
    		printf ( __( 'Website : ', 'bbpress' ));
    		$url='<a href="'.$url.'">'.$url.'</a>';
    		echo $url;
    		echo"</p>" ;
    	}
    }
    add_action ('bbp_template_after_user_profile', 'user_profile_bbp_website_information') ;
    
    #161990
    Master
    Participant

    Did posible use some diferent like this

    <?php if (bbp_get_topic_forum_id() == bbp_get_forum_id('3263')) : ?>

    this show category name for topick from number did posible use letter and from etc category general?

    This work fine http://prntscr.com/73ah8d but u wont use letter not number

Viewing 25 results - 8,776 through 8,800 (of 32,505 total)
Skip to toolbar