Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,451 through 7,475 (of 32,508 total)
  • Author
    Search Results
  • #168420
    Rourke
    Participant

    I’m not getting this to work.

    I have the following code for adding the emoticons plugin. The plugin file is located at /wp-content/themes/theme-child/js/tinymce/emoticons/plugin.min.js:

    add_filter('mce_external_plugins', 'my_custom_plugins');
    function my_custom_plugins($plugins_array) {
    	$plugins = array('emoticons'); //Add any more plugins you want to load here
    
    	//Build the response - the key is the plugin name, value is the URL to the plugin JS
    	foreach ($plugins as $plugin ) {
    		$plugins_array[ $plugin ] = get_stylesheet_directory_uri() . '/js/tinymce/' . $plugin . '/plugin.min.js';
    	}
    	return $plugins_array;
    }

    And for the buttons customization I use:

    function bbp_enable_visual_editor( $buttons = array() ) {
    	
    	$buttons['tinymce'] = array( 
    		'toolbar1' => 'bold, italic, underline, strikethrough, blockquote, alignleft, aligncenter, alignright, alignjustify, justifyfull, bullist, numlist, outdent, indent, undo, redo, link, unlink, table, fullscreen',
    		'toolbar2' => 'formatselect, fontselect, fontsizeselect, styleselect, strikethrough, outdent, indent, pastetext, removeformat, charmap, wp_more, emoticons, forecolor, wp_help,media,image', // 2nd row, if needed
    		'plugins'  => 'paste,emoticons'
    	);
    	$buttons['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');
    	return $buttons;
    }
    add_filter('bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor');
    add_filter('mce_buttons', 'bbp_enable_visual_editor');

    It doesn’t load the visual editor, unless I remove emoticons from the plugins. I don’t see the my_custom_plugins() function doing anything. What am I doing wrong?

    #168414
    Pascal Casier
    Moderator

    Hi,

    Using the shortcode should only show the forums you are allowed to see.
    As administrator/moderator you could see the private ones in the list.
    As participant you should not be able to see it.

    Did you test the access from a user in the ‘participant’ role ?

    Thanks, Pascal.

    paragbhagwat
    Participant

    Hello All,

    I am creating a page which has a short code [bbp-forum-index] and i wanted to know if there is a way to filter out all private forums since this page is only supposed to show public forums.

    Thanks,
    Parag

    #168411
    Robkk
    Moderator

    It works for me if I passed the reply/topic post author’s ID, it doesn’t update immediately though. Running the repair tools for calculating each users counts one by one in Tools > Forums fixed that.

    I think auto-updating the count is part of the latest dev version though.

    Here is the code I used to test it very quick. I just placed this in loop-single-reply.php.

    <?php print bbp_get_user_reply_count( bbp_get_reply_author_id() ) ?>

    #168410
    Rourke
    Participant

    Actually just found the answer by looking at another plugin. There is a hook for it: mce_external_plugins.

    I had some trouble finding it, so it might be usefull for someone else.

    #168409
    Loc Pham
    Participant

    Hi Pascal,
    Yes, I passed in the user id for admin and I’ve always got “0” back and admin had created many topics already.

    bbp_get_user_post_count(1, false);

    Thanks.

    #168408
    Rourke
    Participant

    I want to customize the TinyMCE editor with so called mini-plugins. For example, I have the emoticons mini-plugin that I want to use. When I place it in the folder /wp-includes/js/tinymce/plugins I’m able to use it through a custom wordpress plugin or the functions.php from my theme. But as far as I know this mini-plugin can get removed when wordpress gets updated.

    That’s why I want to know if it’s possible to use these TinyMCE mini-plugins inside my (child) theme instead of just throwing them into core?

    #168404
    o.m.j
    Participant

    unless I’m missing something…I added the below code to my child theme style.css & now pagination top & bottom is gone…

    .bbp-pagination-count {
    display: none;
    }

    #168401
    Pascal Casier
    Moderator

    Hi o.m.j,

    CSS will not help you in this case, not even nth-child or things like

    #bbpress-forums .bbp-pagination-count {
    	display: none;
    }
    #bbpress-forums .bbp-pagination-count ~ .bbp-pagination-count {
    	display: block;
    }

    will not work because the pagination is inside different divs and other elements.

    The only possibility would be somewhere going for a javascript like

    window.onload = function(){
        document.getElementsByClassName('bbp-pagination-count')[0].style.display = 'none';
    }

    (not tested yet) or go for some coding.

    Pascal.

    #168395

    In reply to: Delete “Header”

    Robkk
    Moderator

    You can use this custom CSS to hide it.

    #bbpress-forums li.bbp-header {
        display: none;
    }

    Or you can copy loop-topics.php to your child theme in a folder called bbpress. And remove these lines.

    <li class="bbp-header">
    
    		<ul class="forum-titles">
    			<li class="bbp-topic-title"><?php _e( 'Topic', 'bbpress' ); ?></li>
    			<li class="bbp-topic-voice-count"><?php _e( 'Voices', 'bbpress' ); ?></li>
    			<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?></li>
    			<li class="bbp-topic-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></li>
    		</ul>
    
    	</li>
    #168392
    Loc Pham
    Participant

    Are these three functions broken because I’m receiving zero posts/topics/replies when they’re executed:

    bbp_get_user_post_count()
    bbp_get_user_reply_count()
    bbp_get_user_topic_count()
    #168385
    o.m.j
    Participant

    can someone pls post the code to achieve this using a filter in child theme functions.php

    or maybe a style edit?

    *EDIT* disregard…I used this to remove both

    .bbp-pagination-count {
    display: none;
    }

    #168384
    sucre
    Participant

    Hi all you guys,
    i’ve been trying to display a specific forum in a specific category. Like all categories must have a different forum.

    To do this, i added a text field to the category with Advanced Custom Fields plugin. Then i write [bbp-single-forum id=196] in that field. (196 is the id number of the forum that i want to display for this category)

    To show this, i added this codes to category page in my theme

    <?php 
    $category_id = 'category_' . get_queried_object_id();
    $dforum = get_field( 'forum', $category_id ); 
    ?>
    <?php echo do_shortcode($dforum);
    ?>
    

    it’s working great. However, if you enter a topic (ex. a topic)the page goes to sitename.com/topic/a. But i want to read this topic in the category page. I tried to use iframe but i doesnt work. Please help.

    my site (click forum tab) : http://www.dizimoon.com/kategori/yabanci-diziler/game-of-thrones

    #168378
    ynteligent
    Participant

    Hello,

    I have a page, where I wanted to use shortcode [bbp-single-topic id=$topic_id]. I expected that only lead topic appears, but it does not. There is a lead topic with all replies.

    Is there any way how to display Lead topic only (no replies)?

    Thank you for any peply… Peter

    PS: I tried to use <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> but I did not find out how to use it with specific topic_id….

    #168375
    ynteligent
    Participant

    Hello,

    I have a page, where I wanted to use shortcode [bbp-single-topic id=$topic_id]. I expected that only lead topic appears, but it does not. There is a lead topic with all replies.

    Is there any way how to display Lead topic only (no replies).

    Thank you for any peply… Peter

    PS: I tried to use <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> but I did not find out how to use it with specific topic_id….

    #168372
    Pascal Casier
    Moderator

    Sorry, that page doesn't exist!

    #168366
    Robkk
    Moderator

    The “Forums” page lists all the topics – not the Forums, is that normal?

    It is if you set in Settings > FOrums for the forum root to display topics by freshness.

    Using that shortcode can work too I guess.

    #168364
    Robkk
    Moderator

    It might be better to create a bbpress.php instead of a regular static WordPress page, because that 1 static page will not work for all of the bbPress pages. If you create a bbpress.php, all your bbPress pages will use that template instead.

    See if this guide helps you any.

    Getting Started in Modifying the Main bbPress Template

    Since you using shortcodes you can echo the shortcodes in the bbPRess template like this.

    <?php echo do_shortcode("[shortcode]"); ?>

    #168360

    In reply to: Author avatar issue

    Robkk
    Moderator

    @leirof

    Add this anywhere you can put custom css like in your themes style.css file or in a custom css plugin.

    #bbpress-forums div.bbp-the-content-wrapper input{
      color: #000;
    }
    #168359

    In reply to: 404 error

    Robkk
    Moderator

    Can you see the forums on the frontend of your site??
    Are you saying you cannot see it in the backend in Forums > All FOrums??

    While testing your theme everything works fine for me.

    You can try some troubleshooting to see if this is hopefully not a cache issue, or see if a plugin is causing the conflict, or if running the repair tools in Tools > Forums helps.

    Troubleshooting

    #168356
    Robkk
    Moderator

    Try this php code snippet. Add it to your child themes functions.php file or in a functionality plugin that can hold custom php code snipppets.

    add_filter ('bbp_get_title_max_length','rkk_change_title') ;
    
    Function rkk_change_title ($default) {
    $default=90 ;
    return $default ;
    }
    #168351
    Robkk
    Moderator

    Are you talking about where it says something similar to this in the body class. Most themes add this not really bbPress itself. If you are missing this <?php body_class(); ?> in your theme you not be able to see the post id.

    postid-652

    Or for the topic list of the forum where it shows this.

    bbp-forum-652

    If you have been heavily editing bbPress templates in your child theme you may not have this in correctly in loop-single-forum.

    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>

    #168331

    In reply to: Author avatar issue

    Pascal Casier
    Moderator

    Adapt the ’20px’ to the size you want:

    .bbp-forum-title {
    	font-size: 20px;
    }

    PS. ne jamais dire ‘last question’… you never know what comes up next 🙂

    #168328
    o.m.j
    Participant

    sorry to bump such a old topic, but can someone show the specifc code to add to child theme functions.php? still learning here…

    I tried adding this to functions, but produced an error…

    function bbp_title_max_length( $default = 90 ) {
    	echo bbp_get_title_max_length( $default );
    }
    	/**
    	 * Return the maximum length of a title
    	 *
    	 * @since bbPress (r3246)
    	 * @param $default bool Optional. Default value 90
    	 * @uses get_option() To get the maximum title length
    	 * @return int Is anonymous posting allowed?
    	 */
    	function bbp_get_title_max_length( $default = 90 ) {
    		return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) );
    	}

    thx!

    #168326
    Pascal Casier
    Moderator

    OOOPS! THAT PAGE CAN NOT BE FOUND

Viewing 25 results - 7,451 through 7,475 (of 32,508 total)
Skip to toolbar