Search Results for 'code'
-
Search Results
-
Please tell me the code to get the title of the topic from the ID of the reply.
I wrote the following code, but it will not work on loading with Ajax.
Specifically,
bbp_get_reply_topic_iddoes not seem to work.What am I gonna to do?
function my_echo_topicTitle_from_replyId( $replyId ) { $topicId = bbp_get_reply_topic_id( $replyId ); $page = get_page( $topicId ); $slug = $page->post_name; $topicTitle = get_the_title( $topicId ); echo '<div class="topic_title"><a href="http://example.com/topic/'.$slug.'">'.$topicTitle.'</a></div>'; }Hi,
I want to send notification to my members/ participants, when ever new Forum is created. I found plugin that send email notification when new topic and replies created.
Is there any plugin/code that helps me to send email notification when new Forum is created??
Thanks
Topic: Register button
Shocked that a search for this resulted in nothing. After far too long I finally got a login/register in my sidebar. I tried to add the right widget but could not so I used the login short code.
My question is where can I find out how to use a login/register button instead?
I did find a couple of posts related to this issue but they had not been answered in over a year! I hope I don’t have to wait that long.
Appreciate any help.
Topic: First name and last initial
Hello everyone. I’m using the following snippet that will display the first name and last initial for users in buddypress. However, in bbpress it has no effect. Any ideas on how I could edit this to get it to work for bbpress? I’m so sad that something like this isn’t a default option.
$changeLastInitial = new changeLastInitial; add_filter('bp_displayed_user_fullname', array( $changeLastInitial, 'last_initial' ), 7, 1); add_filter('bp_get_member_name', array( $changeLastInitial, 'last_initial' ), 7, 1); add_filter('bp_get_the_profile_field_value', array( $changeLastInitial, 'last_initial_xprofle' ), 7, 3); add_filter('bp_core_get_user_displayname', array( $changeLastInitial, 'bp_core_get_user_displayname' ), 7, 2); class changeLastInitial { function bp_core_get_user_displayname($name, $id) { $name = $this->last_initial($name); return $name; } function last_initial_xprofle($value, $type, $id) { if ($id == 1) { $value = $this->last_initial($value); } return $value; } function last_initial($name) { $name_a = explode(' ', $name); // if there is at least two parts to the name if (count($name_a) == 2) { // replace the last part of the name with the first letter of the last part $name_a[count($name_a) - 1] = substr($name_a[count($name_a) - 1], 0, 1); // put it all back together $name = implode(' ', $name_a)."."; } return $name; } }WP : 5.0.2
bbPress : 2.5.14
Theme : Custom (built with _S)Hi everyone,
Im having some issues in my custom theme.
I have a custom register page where I put this code :<?php echo do_shortcode( ‘[bbp-register]‘ ); ?>
The thing is, I don’t want the user to be redirected to my wp-login page after registration, for obvious security reasons.
I had a look to some codes but non of them fit to my issue.
Do someone have any idea ?
Cheers,Chaaampy.
WordPress v5.0.3
bbPress v2.5.14Im using the function
bbp_user_favorites_link()on my homepage post content to show a favorite link icon in the upper righthand corner of the post image.When you click it, it goes to the single topic page. The “like” gets liked or unliked but I want to remain on the homepage. i dont want to go to the single topic page when clicking that icon from the homepage.
https://forum.thecritterdepot.com/
Note: You cannot “like” when youre not logged in. But I made a dummy icon that tells you you need to log in when clicked.
I tried looking through all the bbpress “favorites” functions but couldnt figure out how to remove this behavior.
Thanks!
WP : 5.0.2
bbPress : 2.5.14
Theme : Custom (built with _S)Hi everyone,
Im trying to build a custom tinyMCE menubar in my forums.
I disabled the text editor and get to a pretty nice ending, but I don’t know why, I just can’t display the “media” and the “emoticons” button.Here is my code :
function bbp_enable_visual_editor( $buttons = array() ) {
$buttons[‘quicktags’] = false;
$buttons[‘tinymce’] = array(
‘toolbar1′ =>’bold, italic, underline, strikethrough, blockquote, bullist, numlist, link, unlink, cleanup, media, image, emoticons’);
return $buttons;
}add_filter( ‘bbp_after_get_the_content_parse_args’, ‘bbp_enable_visual_editor’ );
Other ones are working fine … Any idea ? Im also trying to build a custom spoiler button, without plugins, but I don’t know where to start either …
Cheers,
Champy.
I am trying to allow users to embed videos by using links such as Youtube. When I do so the videos appears but is cut off because the box is to small to fit the iframe that is added to the site when wordpress adds the embed code. You can see an example here: http://b67.3d8.myftpupload.com/no-shift/topic/messed-up-divorce/
I did some searching and found some CSS that doesn’t work either. Basically it adjusts the width but breaks on the height.
.bbp-reply-content { overflow:hidden; padding-bottom:56.25% !important; position:relative; height:0; } .bbp-reply-content iframe{ left:0; top:0; height:100%; width:100%; position:absolute; }Is there a way to make the WordPress auto embed code responsive in BBPress?
Hello,
I have problem. I have on website bbPress with demo data but when i chose some forum or some subpage it’s blank. https://gamenice.sk/forum/
functions.php
<?php show_admin_bar(false); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); function theme_enqueue_scripts() { $template_directory_uri = get_template_directory_uri(); wp_enqueue_style( 'reset', $template_directory_uri . '/assets/css/reset.min.css', false, '1.0' ); wp_enqueue_style( 'app', $template_directory_uri . '/assets/css/app.min.css?v=' . time(), array( 'reset' ), '1.0' ); wp_enqueue_style( 'forum', $template_directory_uri . '/assets/css/forum.min.css?v=' . time(), array( 'app' ), '1.0' ); wp_enqueue_script( 'html5shiv', $template_directory_uri . '/assets/js/html5shiv.min.js' ); wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' ); wp_enqueue_script( 'selectivizr', $template_directory_uri . '/assets/js/selectivizr.min.js' ); wp_script_add_data( 'selectivizr', 'conditional', 'lt IE 9' ); wp_enqueue_script( 'jquery', $template_directory_uri . '/assets/js/jquery.min.js', false, '3.3.1' ); wp_enqueue_script( 'app', $template_directory_uri . '/assets/js/app.js', array( 'jquery' ), '1.0' ); wp_localize_script( 'app', 'carouselSettings', array( 'timeout' => get_option('carousel_timeout').'000' ) ); } add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' ); function get_excerpt($where = ''){ $excerpt = get_the_content(); $excerpt = strip_shortcodes($excerpt); $excerpt = strip_tags($excerpt); switch ($where) { case 'carousel': if ( wp_is_mobile() ) $excerpt = substr($excerpt, 0, 120); else $excerpt = substr($excerpt, 0, 250); break; case 'head': $excerpt = substr($excerpt, 0, 200); break; default: if ( wp_is_mobile() ) $excerpt = substr($excerpt, 0, 300); else $excerpt = substr($excerpt, 0, 725); break; } $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); $excerpt = $excerpt.'...'; return $excerpt; } function get_thumbnail_url() { $thumbnail = get_the_post_thumbnail_url() != '' ? get_the_post_thumbnail_url() : get_template_directory_uri() . '/assets/img/og-image.png'; return $thumbnail; } function themename_custom_logo_setup() { $defaults = array( 'height' => 111, 'width' => 220, 'flex-height' => true, 'flex-width' => true, ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'themename_custom_logo_setup' ); add_theme_support( 'post-thumbnails' ); function register_my_menus() { register_nav_menus( array( 'header-menu' => __( 'Header Menu' ), 'footer-menu' => __( 'Footer Menu' ) ) ); } add_action( 'init', 'register_my_menus' ); function show_menu($menu_name) { $defaults = array( 'theme_location' => '', 'menu' => $menu_name, 'container' => '', 'container_class' => '', 'container_id' => '', 'menu_class' => $menu_name, 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul class="inline-list %2$s">%3$s</ul>', 'depth' => 0, 'walker' => '' ); wp_nav_menu($defaults); } include 'inc/theme-settings.php';forum.php
<?php include 'header.php'; ?> <section class="forum-wrapper"> <div class="container"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?> </div> </section> <?php include 'footer.php'; ?>