Hỏi muốn xóa phần feature images hiển thị ở trên title bài viết WordPress?
Trả lời câu hỏi tuần 4 tháng 6/2015 của bạn Nguyễn Tú Anh hỏi muốn xóa phần feature images hiển thị ở trên title bài viết WordPress.
Thuộc chủ đề Hỏi đáp WordPress / Hướng dẫn sử dụng WordPress |
Bạn Nguyễn Tú Anh hỏi:
Các bác giúp em với ạ, em muốn xóa phần feature images hiển thị ở trên title bài viết. trong theme ko có option này em nhìn trong single.php k thấy phần này được set ở đâu. có bác nào từng gặp trường hợp này có thể giúp em được ko ạ
php code của single.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
<?php /** * Theme's generic Single post page */ ?> <?php // print site header get_header(); ?> <?php // sidebar $sidebar_class = ''; $sidebar_pos = vp_option( 'vpt_option.sidebar_position' ); if( $sidebar_pos == 'left' ) $sidebar_class = ' col-lg-push-4 col-md-push-4'; ?> <div class="row no-gutter"><!-- row --> <div class="col-lg-8 col-md-8<?php echo $sidebar_class; ?>"><!-- doc body wrapper --> <div class="col-padded"><!-- inner custom column --> <?php if( have_posts() ) : ?> <div class="row gutter"><!-- row --> <?php while( have_posts() ) : the_post(); // include template for different post formats correspondingly get_template_part( 'content', get_post_format() ); // main loop end endwhile; ?> <?php k_share_with_add_this(); // addthis Post sharing ?> </div><!-- row end --> <?php k_paging(); //post paging ?> <div class="row row-splitter"></div> <?php comments_template(); // post comments ?> <?php else : ?> <div class="row gutter"><!-- row --> <?php get_template_part( 'content', 'none' ); ?> </div><!-- row end --> <?php endif; ?> </div><!-- inner custom column end --> </div><!-- doc body wrapper end --> <?php // print sidebar wrappers - open k_sidebar_head(); // print sidebar content get_template_part( 'sidebars/sidebar-single' ); // print sidebar wrappers - close k_sidebar_foot(); ?> </div><!-- row end --> <?php // print site footer get_footer(); ?> |
Trả lời câu hỏi trên Facebook:
Phan Thanh Phú bạn tìm file content.php, có thể nó trong đó
Nguyễn Tú Anh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
<?php /** * Image template, used to display image attachments */ ?> <?php // print site header get_header(); ?> <div class="row no-gutter fullwidth"><!-- row --> <div class="col-lg-12 col-md-12"><!-- doc body wrapper --> <div class="col-padded"><!-- inner custom column --> <figure class="news-featured-image"> <?php k_attached_image(); ?> </figure> <h1 class="page-title"><?php the_title(); ?></h1> <div class="news-meta"> <?php $published_text = __( '<span class="news-meta-date"><time class="entry-date" datetime="%1$s">%2$s</time></span><span class="news-meta-category"><a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'kazaz' ); $post_title = get_the_title( $post->post_parent ); if( empty( $post_title ) || 0 == $post->post_parent ) $published_text = '<span class="news-meta-date"><time class="entry-date" datetime="%1$s">%2$s</time></span>'; printf( $published_text, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_permalink( $post->post_parent ) ), esc_attr( strip_tags( $post_title ) ), $post_title ); $metadata = wp_get_attachment_metadata(); printf( '<span class="news-meta-comments"><a href="%1$s" title="%2$s">%3$s (%4$s × %5$s)</a></span>', esc_url( wp_get_attachment_url() ), esc_attr__( 'Link to full-size image', 'kazaz' ), __( 'Full resolution', 'kazaz' ), $metadata[ 'width' ], $metadata[ 'height' ] ); edit_post_link( __( 'Edit', 'kazaz' ), '<span class="news-meta-comments">', '</span>' ); ?> </div> <?php if( $post->post_content ) : ?> <hr /> <?php echo '<p>' . $post->post_content . '</p>'; ?> <hr /> <?php endif; ?> <div class="gap60"></div> <div class="clearfix"> <?php previous_image_link( false, '<span class="pull-left"><i class="fa fa-chevron-left"></i> ' . __( 'Previous image', 'kazaz' ). '</span>' ); ?> <?php next_image_link( false, '<span class="pull-right">' . __( 'Next image', 'kazaz' ) . ' <i class="fa fa-chevron-right"></i></span>' ); ?> </div> <div class="row row-splitter"></div> <?php comments_template(); ?> </div><!-- inner custom column end --> </div><!-- doc body wrapper end --> </div><!-- row end --> <?php // print site footer get_footer(); ?> |
Nguyễn Tú Anh phải cái này ko ạ @@. zờ em xóa đoạn nào hả bác
Đoàn Việt Quân bỏ đoạn này thì phải
1 2 3 |
<figure class="news-featured-image"> <?php k_attached_image(); ?> </figure> |
Nguyễn Tú Anh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
<?php /** * Default Content Template */ ?> <?php if( is_single() ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'col-lg-12 col-md-12' ); ?>> <?php if( has_post_thumbnail() && !post_password_required() && !is_attachment() ) : ?> <figure class="news-featured-image"> <?php the_post_thumbnail(); ?> </figure> <?php endif; ?> <div class="news-title-meta"><!-- title and meta wrapper --> <h1 class="page-title"><?php the_title(); ?></h1> <?php k_post_meta(); // print date, author and comments number ?> <div class="news-body"> <?php if( has_excerpt() ) : ?><div class="call-out"><?php the_excerpt(); ?></div><?php endif; ?> <?php the_content(); // full content ?> </div> <?php k_post_tags(); // print post tags if any ?> </div><!-- title and meta wrapper end --> </div> <?php elseif( is_category() ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'news-mini-wrap col-lg-6 col-md-6' ); ?>><!-- news wrap --> <?php if( has_post_thumbnail() && !post_password_required() && !is_attachment() ) : ?> <figure class="news-featured-image"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array( 'before' => 'Permalink to: ', 'after' => '' ) ); ?>"><?php the_post_thumbnail(); ?></a> </figure> <?php endif; ?> <h1 class="page-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array( 'before' => 'Permalink to: ', 'after' => '' ) ); ?>"><?php the_title(); ?></a> </h1> <?php k_post_meta(); // print date, author and comments number ?> <div class="news-summary"> <?php // print excerpt - if any, otherwise trim it up automatically if( has_excerpt() ) echo '<p>' . get_the_excerpt() . '</p>'; else echo '<p>' . wp_trim_excerpt() . '</p>'; ?> </div> </div><!-- news wrap end--> <?php elseif( is_home() || is_front_page() ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'news-stacked col-lg-12 col-md-12' ); ?>><!-- news wrap --> <?php if( has_post_thumbnail() && !post_password_required() && !is_attachment() ) : ?> <figure class="news-featured-image"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array( 'before' => 'Permalink to: ', 'after' => '' ) ); ?>"><?php the_post_thumbnail(); ?></a> </figure> <?php endif; ?> <h1 class="page-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array( 'before' => 'Permalink to: ', 'after' => '' ) ); ?>"><?php the_title(); ?></a> </h1> <?php k_post_meta(); // print date, author and comments number ?> <div class="news-summary"> <?php // print excerpt - if any, otherwise trim it up automatically if( has_excerpt() ) echo '<p>' . get_the_excerpt() . '</p>'; else echo '<p>' . wp_trim_excerpt() . '</p>'; ?> </div> </div> <?php else : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'news-stacked col-lg-12 col-md-12' ); ?>><!-- content wrap --> <h1 class="page-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array( 'before' => 'Permalink to: ', 'after' => '' ) ); ?>"><?php the_title(); ?></a> </h1> <?php if( get_post_type() == 'post' ) k_post_meta(); // print date, author and comments number elseif( get_post_type() == 'event' || get_post_type() == 'course' || get_post_type() == 'gallery' ) echo k_cpt_meta(); // print info ?> <div class="news-summary"> <?php // print excerpt - if any, otherwise trim it up automatically if( has_excerpt() ) the_excerpt(); else echo '<p>' . wp_trim_excerpt() . '</p>'; ?> </div> </div> <?php endif; ?> |
Nguyễn Tú Anh đây là file content.php. hok bít xóa đoạn nào okie test thử cái. cảm ơn các bác
Nguyễn Tú Anh okie cảm ơn các bác, đã xóa xong
Nếu bạn có những ý kiến đóng góp nào khác về muốn xóa phần feature images hiển thị ở trên title bài viết WordPress xin hãy để lời bình luận phía dưới, chúng tớ sẽ phản hồi lại. Chúc bạn Học WordPress hiệu quả.
Các bài viết cùng chủ đề:
- Hỏi cách Query Post khi mình vào post 2 thì sẽ hiển thị các bài viết liên quan là post 3,4?
- Hỏi cách chuyển Page sang bài viết trên Web WordPress?
- Hỏi làm thế nào không hiển thị ảnh nổi bật trong post bài viết WordPress?
- Hỏi lỗi share bài viết lên facebook?
- Hỏi Không hiện ảnh đại diện trong bài viết WordPress?
Bạn có thể tham khảo thêm phần: Hướng dẫn học lập trình PHP cho người mới bắt đầu
WordPress Tiếng Việt > Hoc WordPress > Sử dụng WordPress > Hỏi đáp WordPress
Chuyên đề bạn đọc:
Hoc WordPress | Su dung WordPress | Lap trinh WordPress | Cai dat WordPress | Huong dan hoc WordPress | Huong dan su dung WordPress | WordPress Tieng Viet | Tụ hoc WordPress | Cach su dung WordPress
Viết bình luận
Tất cả bình luận