ctltvoz
Forum Replies Created
-
How did you solve it? I have samve problem.
Forum: Plugins
In reply to: [Yoast SEO] 301 RedirectPlease bring it back.
Same thing happened to my site – Error code: -32601
Forum: Fixing WordPress
In reply to: How to disable "Focus on your content" on WordPress 4.0Dear James
Thank you very much for your help.
There is not any problem with “Expand the editor”. It works well – but in my case, the post is very long so it would a bit hard for me to work with it. Now it is ok after unchecking the “Expand the editor to match the window height”
I am happy with it now.
Forum: Fixing WordPress
In reply to: How to disable "Focus on your content" on WordPress 4.0Hi James
“The focus on your content” is a part of the WordPress 4.0.
See it here – part 4 from top.
Forum: Fixing WordPress
In reply to: Wrong post_date after updating postThese days – there is problem with timezone…it works incorrectly
Forum: Plugins
In reply to: [WP RSS Multi Importer] Wrong Timezone issueSame thing happen to me – but I don’t use autoPost.
All my post that I scheduled today did not work; there is problem with wordpress timezone now – Please fix.
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.Hi! I found a new way to make it work. I put // into the following:
<?php wp_editor( '', 'comment', array( 'media_buttons' => false, 'textarea_rows' => '3', //'tinymce' => array( //'plugins' => 'inlinepopups, wordpress, wplink, wpdialogs', //'theme_advanced_buttons1' => 'bold, italic, underline, strikethrough, forecolor, separator, bullist, numlist, separator, link, unlink, image','theme_advanced_buttons2' => ''), //'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close') )); ?>
I think these lines conflict with wordpress comment function.
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.I removed that code and added <?php comment_form(); ?> to it. I think it is Ok now.
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.Here is my functions file.
<?php //Cho phep editor function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' ); /* ------------------------- Add Theme Options, Include Modun ---------------------- */ include_once('admin/index.php'); include_once('includes/index.php'); /* -------------------------------Add Theme Support -------------------------------- */ add_theme_support('post-thumbnails', array('post')); add_theme_support('post-formats', array('image', 'video', 'audio')); add_image_size('image', 55, 55, true); register_nav_menu('menu', __('Danh m?c')); register_sidebar(array( 'name' => 'Header', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<span class="title">', 'after_title' => '</span>', )); register_sidebar(array( 'name' => 'Home', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<span class="title">', 'after_title' => '</span>', )); register_sidebar(array( 'name' => 'Footer', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<span class="title">', 'after_title' => '</span>', )); function TrimStringIfToLong($s) { $maxLength = 60; if (strlen($s) > $maxLength) { echo substr($s, 0, $maxLength - 5) . ' ...'; } else { echo $s; } } /* ------------------------------- Get First Image -------------------------------- */ function first_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; return $first_img; } /* ----------------------------------- Post View ---------------------------------- */ function get_bbit_views($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return "0"; } return $count; } function bbit_views($postID) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } /* ------------------------------------ Pagenavi ----------------------------------- */ function bbit_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class='pad pagenavi'>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'> <<</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'> <</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class='NowPage'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='NextPage' >".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>> </a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>>> </a>"; echo "</div>\n"; } } /* ---------------------------------- Limited Text --------------------------------- */ function bbit_string_limit($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { array_pop($words); } return implode(' ', $words); } /* ------------------------------------ Time Ago ----------------------------------- */ function bbit_time_ago() { global $post; $date = get_post_time('G', true, $post); $chunks = array( array( 60 * 60 * 24 * 365 , __( 'n?m'), __( 'n?m') ), array( 60 * 60 * 24 * 30 , __( 'tháng'), __( 'tháng') ), array( 60 * 60 * 24 * 7, __( 'tu?n'), __( 'tu?n') ), array( 60 * 60 * 24 , __( 'ngày'), __( 'ngày') ), array( 60 * 60 , __( 'gi?'), __( 'gi?') ), array( 60 , __( 'phút'), __( 'phút') ), array( 1, __( 'giay'), __( 'giay') ) ); if ( !is_numeric( $date ) ) { $time_chunks = explode( ':', str_replace( ' ', ':', $date ) ); $date_chunks = explode( '-', str_replace( ' ', '-', $date ) ); $date = gmmktime( (int)$time_chunks[1], (int)$time_chunks[2], (int)$time_chunks[3], (int)$date_chunks[1], (int)$date_chunks[2], (int)$date_chunks[0] ); } $current_time = current_time( 'mysql', $gmt = 0 ); $newer_date = strtotime( $current_time ); $since = $newer_date - $date; if ( 0 > $since ) return __( 'sometime'); for ( $i = 0, $j = count($chunks); $i < $j; $i++) { $seconds = $chunks[$i][0]; if ( ( $count = floor($since / $seconds) ) != 0 ) break; } $output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2]; if ( !(int)trim($output) ){ $output = '0 ' . __( 'giay'); } $output .= __(' tr??c'); return $output; } add_filter('the_time', 'bbit_time_ago'); /* -------------------------- Auto Remove Empty Meta Value ------------------------- */ add_action('save_post','bbit_auto_remove_meta'); function bbit_auto_remove_meta($post_id) { if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return; if (!current_user_can('edit_post', $post_id)) return; $custom_fields = get_post_custom($post_id); if(!$custom_fields) return; foreach($custom_fields as $key=>$custom_field): $values = array_filter($custom_field); if(empty($values)): delete_post_meta($post_id,$key); endif; endforeach; return; } /* ------------------------------- Modun Not Outlink ------------------------------- */ class bbit_outlink { public function __construct() { add_action( 'wp', array( $this, 'call_wp' ) ); } function call_wp() { if ( ! is_admin() && ! is_feed() ) { $priority = 1000000000; add_filter( 'the_title', array( $this, 'call_filter_content' ), $priority ); add_filter( 'the_content', array( $this, 'call_filter_content' ), $priority ); add_filter( 'get_the_excerpt', array( $this, 'call_filter_content' ), $priority ); } do_action('wpel_ready', array($this, 'call_filter_content'), $this); } function call_filter_content( $content ) { return $this->filter( $content ); } function is_external( $href, $rel ) { for ( $x = 0, $count = count($this->ignored); $x < $count; $x++ ) { if ( strrpos( $href, $this->ignored[ $x ] ) !== FALSE ) return FALSE; } return ( isset( $href ) AND ( strpos( $rel, 'external' ) !== FALSE OR ( strpos( $href, strtolower( get_bloginfo( 'wpurl' ) ) ) === FALSE ) AND ( substr( $href, 0, 7 ) == 'https://' OR substr( $href, 0, 8 ) == 'https://' OR substr( $href, 0, 6 ) == 'ftp://' ) ) ); } function filter( $content ) { $content = preg_replace_callback( '/<a[^A-Za-z](.*?)>(.*?)<\/a[\s+]*>/is', array( $this, 'call_parse_link' ), $content ); return $content; } function call_parse_link( $matches ) { $attrs = $matches[ 1 ]; $attrs = stripslashes( $attrs ); $attrs = shortcode_parse_atts( $attrs ); $rel = ( isset( $attrs[ 'rel' ] ) ) ? strtolower( $attrs[ 'rel' ] ) : ''; $href = $attrs[ 'href' ]; $href = strtolower( $href ); $href = trim( $href ); if ( ! $this->is_external( $href, $rel ) ) return $matches[ 0 ]; $this->add_attr_value( $attrs, 'rel', 'nofollow' ); $link = '<a '; foreach ( $attrs AS $key => $value ) $link .= $key .'="'. $value .'" '; $link = substr( $link, 0, -1 ); $link .= '>'. $matches[ 2 ] .'</a>'; $link = apply_filters('wpel_external_link', $link, $matches[ 0 ], $matches[ 2 ], $attrs); return $link; } function add_attr_value( &$attrs, $attr_name, $value, $default = NULL ) { if ( key_exists( $attr_name, $attrs ) ) $old_value = $attrs[ $attr_name ]; if ( empty( $old_value ) ) $old_value = ''; $split = split( ' ', strtolower( $old_value ) ); if ( in_array( $value, $split ) ) { $value = $old_value; } else { $value = ( empty( $old_value ) ) ? $value : $old_value .' '. $value; } if ( empty( $value ) AND $default === NULL ) { unset( $attrs[ $attr_name ] ); } else { $attrs[ $attr_name ] = $value; } return $value; } } $bbit_outlink = new bbit_outlink(); /* -------------------------------- Comment Option --------------------------------- */ function bbit_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <article id="comment-<?php comment_ID() ?>"> <span class="icon_comment"><strong><?php echo get_comment_author_link() ?></strong></span> <small><?php printf(__('%1$s lúc %2$s'), get_comment_date(), get_comment_time()) ?></small> <?php if ($comment->comment_approved == '0') : ?><em>Bình lu?n ch? duy?t!</em><br><?php endif; ?> <?php comment_text() ?> </article> <?php }
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.What theme were you using? Where did you download it from?
The theme is not on a store. Someone wrote this theme to optimize for wapsite, I bought from them. I asked them for help but they say WordPress 3.9.1 have problem with Visual Editor; they asked me to wait for the new fix. ??
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.This is my comment template.
<?php if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); ?> <span class="title">Bình lu?n (<?php comments_number(__('0'), __('1'), __('%'));?>)</span> <?php if ( have_comments() ) : ?> <?php wp_list_comments('type=comment&avatar_size=60&callback=bbit_comment'); ?> <span class="left"><?php previous_comments_link(); ?></span> <span class="right"><?php next_comments_link(); ?></span> <br> <?php else : ?> <?php endif; ?> <?php if ( comments_open() ) : ?> <div class="pad" id="respond"> <p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p> <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> <p>Vui lòng <a href="<?php echo wp_login_url( get_permalink() ); ?>">??ng nh?p</a> ?? bình lu?n.</p> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post"> <?php if ( is_user_logged_in() ) : ?> <em>Chào <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>!</em><br> <?php wp_editor( '', 'comment', array( 'media_buttons' => false, 'textarea_rows' => '3', 'tinymce' => array( 'plugins' => 'inlinepopups, wordpress, wplink, wpdialogs', 'theme_advanced_buttons1' => 'bold, italic, underline, strikethrough, forecolor, separator, bullist, numlist, separator, link, unlink, image','theme_advanced_buttons2' => ''), 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close') )); ?> <button type="submit">G?i</button> <?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID); ?> <?php else : ?> <input placeholder="Tên b?n" type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" /><br> <input placeholder="Email" type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" /><br> <?php wp_editor( '', 'comment', array( 'media_buttons' => false, 'textarea_rows' => '3', 'tinymce' => array( 'plugins' => 'inlinepopups, wordpress, wplink, wpdialogs', 'theme_advanced_buttons1' => 'bold, italic, underline, strikethrough, forecolor, separator, bullist, numlist, separator, link, unlink, image','theme_advanced_buttons2' => ''), 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close') )); ?> <button type="submit">G?i</button> <?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID); ?> <?php endif; ?> </form> <?php endif;?> </div> <?php endif; ?>
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.I think it is a part of my theme. Is there anyway I can disable my theme comment?
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.I changed it default theme – See it here; https://truyengay.mobi/truyen-gay-boy-u-day-lam-gi-nhau/
I would like to have the comment without Visual Editor like the default Twenty Fourteen theme.
Forum: Fixing WordPress
In reply to: [NSFW] Visual vs Text Editor does not work properly.please wait a moment.