KAK сделать пост видимым без заголовка????
-
Помогите! Ставлю пост, как статус, или как aside. Его не видно!!!!! потому что нет заголовка. а мне не нужен заголовок. это просто короткие анекдоты, идут себе лентой. Что, придумывать заголовок к каждому анекдоту???? Что-то я не так делаю. Как их сделать видимыми эти посты короткие? Чтоб выглядело как сатус на Фейсбуке например. Шлепнул анекдот и все!
Помогите!!!!!!
-
and nobody answers 🙁
Чтобы вывести рядом с заголовком записи (или вместо него) её содержимое, нужно добавить в шаблон вызов the_content().
В какой шаблон и куда именно — зависит от используемой темы оформления.
простите, а поподробнее можно? я не в коде не лазаю. и ничего в нем не понимаю. Можете помочь? куда добавлять и как? Заранее спасибо!!!
А что вам мешает при создании записи, оставлять заголовок пустым? Тем самым заголовок у вас выводиться не будет.
Другое дело, если у вас на желаемой странице сайта (скорее всего рубрика) не предусмотрен вывод самого контента записи, а вместо него выводится заголовок и цитата записи. Тогда как вариант, чтобы не лезть в код можно сделать так: Заполняйте анекдоты как обычную запись, только при этом заголовок оставляйте пустым и сам анекдот заполняйте в Цитату (чтобы включить цитату сверху на странице оформления поста нужно кликнуть по «Настройка экрана» и там поставить галку на «Цитата») вместо контента.
Да. у меня как я понимаю, не предусмотрен вывод контента записи без заголовка. если нет заголовка, запись не показывается… попробовала статус, попробовала aside… а вот цитаты не пробовала. попробую с цитатами! спасибо! доложу, получилось или нет:-)
неа. не работает цитата. да что ж делать-то? ((((
нашла файл:DynamiX: content-status.php. тут надо менять что-то?
<?php /** * The template for displaying posts in the Status Post Format on index and archive pages * * @package WordPress */ /* :: Get Custom Field Data --------------------------------------------- */ include(NV_FILES .'/inc/classes/post-fields-class.php'); /* :: / ------------------------------------- */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="article-row row"> <aside class="post-metadata columns two"> <?php echo get_avatar( get_the_author_meta( 'ID' ), 70 ); ?> </aside><!-- /post-metadata --> <section class="entry <?php echo $columns; ?>"> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <?php the_excerpt(); ?> <?php else : ?> <small class="status-time"><?php _e( 'By ', 'themeva' ); echo get_the_author_meta('first_name') ." ". get_the_author_meta('last_name') .' '; _e( 'On ', 'themeva' ); the_time('F j, Y g:i a'); ?></small> <?php do_shortcode(the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'themeva' ) )); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'themeva' ) . '</span>', 'after' => '</div>' ) ); ?> <?php endif; ?> </section><!-- / .entry --> </div> <?php // Check if placed within a widget if( $NV_is_widget != true ) { include(NV_FILES .'/inc/classes/post-footer-class.php'); } ?> </article><!-- #post-<?php the_ID(); ?> -->Покажите сам сайт и страницу на которой вы хотите получить желаемый результат.
Теперь покажите код шаблонов category.php и arhive.php из папки вашей темы: \wp-content\themes\Dynamix_Theme\
архивы нашла:
<?php /** * @package WordPress * @subpackage NorthVantage */ get_header(); $NV_layout = of_get_option('arhlayout','layout_four'); // Grid Layout Options $count = 1; $NV_postlayout = of_get_option('arhpostdisplay',''); $NV_gridcols = of_get_option('arhpostcolumns','2'); if( $NV_hidecontent != "yes" ) { $columns = ''; if( $NV_layout == "layout_one" ) $columns = 'twelve'; elseif( $NV_layout == "layout_two" ) $columns = 'eight last'; elseif( $NV_layout == "layout_three" ) $columns = 'six last'; elseif( $NV_layout == "layout_four" ) $columns = 'eight'; elseif( $NV_layout == "layout_five" ) $columns = 'six'; elseif( $NV_layout == "layout_six" ) $columns = 'six'; else $columns = 'eight'; echo "\n\t". '<div id="content" class="columns '. $columns .' '. $NV_layout .'">'; // Filter Post Formats /* function FormatFilter($query) { if ($query->is_archive) { $filter_formats = of_get_option('filter_formats'); $filterformats = ''; if( !empty($filter_formats) ) { foreach( $filter_formats as $format => $value ) { if( $value == 1 ) { echo $format; $filterformats[] = 'post-format-'. $format; } } } $taxquery = array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => $filterformats, 'operator' => 'NOT IN' ) ); $query->set('tax_query', $taxquery); } return $query; } if( of_get_option('filter_formats') != '' ) add_filter('pre_get_posts','FormatFilter'); */ if (have_posts()) : ?> <h2 class="archive-title"> <?php if ( is_day() ) : printf( __( 'Всё за один день: %s', 'themeva' ), '<span>' . get_the_date() . '</span>' ); elseif ( is_month() ) : printf( __( 'Архив за месяц: %s', 'themeva' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'themeva' ) ) . '</span>' ); elseif ( is_year() ) : printf( __( 'Архив за год: %s', 'themeva' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'themeva' ) ) . '</span>' ); elseif ( is_category() ) : printf( __( '%s', 'themeva' ), '<span>' . single_cat_title( '', false ) . '</span>' ); else : _e( 'Archives', 'themeva' ); endif; ?> </h2> <?php while (have_posts()) : the_post(); // Setup Grid Layout if( $NV_postlayout == 'grid' ) { if( $count == $NV_gridcols ) { $class = 'last'; $count = 1; } elseif( $count == 1 ) { $class= 'clear'; $count++; } else { $class = ''; $count++; } echo '<div class="columns '. numberToWords( $NV_gridcols ) .'_column grid_layout '. $class .'">'; get_template_part( 'content', get_post_format()); echo '</div>'; } else { get_template_part( 'content', get_post_format()); } endwhile; else : if ( is_category() ) { // If this is a category archive printf("<h2 class='center'>". __("Sorry, but there aren't any posts in the %s category yet.", 'themeva' ) ."</h2>", single_cat_title('',false)); } else if ( is_date() ) { // If this is a date archive echo("<h2>". __( "Sorry, but there aren't any posts with this date.", 'themeva' ) ."</h2>"); } else if ( is_author() ) { // If this is a category archive $userdata = get_userdatabylogin(get_query_var('author_name')); printf("<h2 class='center'>". __("Sorry, but there aren't any posts by %s yet.", 'themeva' ) ."</h2>", $userdata->display_name); } else { echo("<h2 class='center'>". __('No posts found.', 'themeva' ) ."</h2>"); } endif; $postcount = 0; global $wp_query; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1) { $current_page = max(1, get_query_var('paged')); echo '<div class="page_nav">'; echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => 'page/%#%', 'current' => $current_page, 'total' => $total_pages, 'prev_text' => '«', 'next_text' => '»' )); echo '</div>'; } wp_reset_query(); echo "\n\t\t". '<div class="clear"></div>'; echo "\n\t". '</div><!-- #content -->'; get_sidebar(); } // Hide Content *END* get_footer();категорий не нашла. нашла single post.php.
<?php /** * @package WordPress * @subpackage NorthVantage */ get_header(); global $NV_layout; if( empty( $NV_layout ) ) { $NV_layout = of_get_option('pagelayout'); } if( $NV_hidecontent != "yes" ) { if (have_posts()) : $columns = ''; if( $NV_layout == "layout_one" ) $columns = 'twelve'; elseif( $NV_layout == "layout_two" ) $columns = 'eight last'; elseif( $NV_layout == "layout_three" ) $columns = 'six last'; elseif( $NV_layout == "layout_four" ) $columns = 'eight'; elseif( $NV_layout == "layout_five" ) $columns = 'six'; elseif( $NV_layout == "layout_six" ) $columns = 'six'; else $columns = 'eight'; echo "\n\t". '<div id="content" class="columns '. $columns .' '. $NV_layout .'">'; while (have_posts()) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; endif; echo "\n\t". '</div><!-- #content -->'; get_sidebar(); } // Hide Content *END* get_footer();и нашла DynamiX: content.php
<?php /** * The template for displaying content in the single.php template * * @package WordPress */ /* :: Get Custom Field Data --------------------------------------------- */ include(NV_FILES .'/inc/classes/blog-class.php'); include(NV_FILES .'/inc/classes/post-fields-class.php'); /* :: / ------------------------------------- */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="article-row row"> <?php if( $NV_arhpostpostmeta == 'display' && $NV_postmetaalign != 'post_title' ) { ?> <aside class="post-metadata columns two"> <?php include(NV_FILES .'/inc/classes/metadata-class.php'); ?> </aside><!-- /post-metadata --> <?php } ?> <header class="post-titles <?php echo $columns; ?>"> <?php if( !empty($NV_previewimgurl) && $NV_displayblogimage == 'display' ) { echo do_shortcode('[imageeffect type="'.$NV_imageeffect.'" align="'.$NV_imgalign.'" '.$NV_image_size.' alt="'.get_the_title().'" link="'.$NV_permalink.'" '.$NV_showlightbox.' url="'.$NV_previewimgurl.'" ]'); } include(NV_FILES .'/inc/classes/post-title-class.php'); // Style Post Titles if( $NV_arhpostpostmeta == 'display' && $NV_postmetaalign == 'post_title' ) { include(NV_FILES .'/inc/classes/metadata-class.php'); } ?> </header><!-- / .post-titles --> <section class="entry <?php echo $columns; ?>"> <?php echo $NV_description; if( empty( $NV_disablereadmore ) ) $NV_disablereadmore=''; if( $NV_disablegallink != 'yes' && $NV_disablereadmore != 'yes' && $NV_nolink != 'yes' ) { echo themeva_readmore( $post_link ); } wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Страницы:', 'themeva' ) . '</span>', 'after' => '</div>' ) ); ?> </section><!-- / .entry --> </div> <?php // Check if placed within a widget if( $NV_is_widget != true ) { include(NV_FILES .'/inc/classes/post-footer-class.php'); } ?> </article><!-- #post-<?php the_ID(); ?> -->I checked on C panel too. there is no category.php file. content — yes. archives — yes. 🙁
Спасибо Вам огромное за то, что возитесь!!!!!!
Тема «KAK сделать пост видимым без заголовка????» закрыта для новых ответов.