• Resolved avaja

    (@avaja)


    1. I am using theme “Graphy”
    2. I am using a category menu
    3. I selected “Full Text” in Appearance>Customize>Article

    But why does my article still shows only a summary on the page?
    Thanks!!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The only thing I can think of is that it didn’t save properly.

    When you go back into Customize, does it show “Full Text” or “Summary”?

    Switch between the two, make sure Full Text is selected and then hit Save & Publish.

    Thread Starter avaja

    (@avaja)

    Thank you for your prompt reply, WPMadeEasy!
    I did choose the “Full Text” in the Appearance>Customize>Article place.
    I think the problem lies in the Category thing
    because when I click a normal page, the articles are displayed in full text,
    but when I click the menu which is made from a category, it shows only summaries of posts under this category; same is true when I hit a category name and all the posts are displayed in summary form.

    So the problem becomes “How do we show full text posts under Categories?”

    Thanks!

    Thread Starter avaja

    (@avaja)

    I searched some related forum posts, and found that I need to change “‘the_excerpt()’ to ‘the_content()’ in the Theme template. But I can’t find that in my Archive.php. What shall I do?

    Here’s the full code of the archive.php in this template:

    <?php
    /**
    * The template for displaying Archive pages.
    *
    * Learn more: http://codex.wordpress.org/Template_Hierarchy
    *
    * @package Graphy
    */

    get_header(); ?>

    <section id=”primary” class=”content-area”>
    <main id=”main” class=”site-main” role=”main”>

    <?php if ( have_posts() ) : ?>

    <header class=”page-header”>
    <h1 class=”page-title”>
    <?php
    if ( is_category() ) :
    single_cat_title( __( ‘Category: ‘, ‘graphy’ ) );

    elseif ( is_tag() ) :
    single_tag_title( __( ‘Tag: ‘, ‘graphy’ ) );

    elseif ( is_author() ) :
    /* Queue the first post, that way we know
    * what author we’re dealing with (if that is the case).
    */
    the_post();
    printf( __( ‘Author: %s’, ‘graphy’ ), ‘<span class=”vcard”>’ . get_the_author() . ‘</span>’ );
    /* Since we called the_post() above, we need to
    * rewind the loop back to the beginning that way
    * we can run the loop properly, in full.
    */
    rewind_posts();

    elseif ( is_day() ) :
    printf( __( ‘Day: %s’, ‘graphy’ ), ‘<span>’ . get_the_date() . ‘</span>’ );

    elseif ( is_month() ) :
    printf( __( ‘Month: %s’, ‘graphy’ ), ‘<span>’ . get_the_date( _x( ‘F Y’, ‘monthly archives date format’, ‘graphy’ ) ) . ‘</span>’ );

    elseif ( is_year() ) :
    printf( __( ‘Year: %s’, ‘graphy’ ), ‘<span>’ . get_the_date( _x( ‘Y’, ‘yearly archives date format’, ‘graphy’ ) ) . ‘</span>’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-aside’ ) ) :
    _e( ‘Asides’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-gallery’ ) ) :
    _e( ‘Galleries’, ‘graphy’);

    elseif ( is_tax( ‘post_format’, ‘post-format-image’ ) ) :
    _e( ‘Images’, ‘graphy’);

    elseif ( is_tax( ‘post_format’, ‘post-format-video’ ) ) :
    _e( ‘Videos’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-quote’ ) ) :
    _e( ‘Quotes’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-link’ ) ) :
    _e( ‘Links’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-status’ ) ) :
    _e( ‘Statuses’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-audio’ ) ) :
    _e( ‘Audios’, ‘graphy’ );

    elseif ( is_tax( ‘post_format’, ‘post-format-chat’ ) ) :
    _e( ‘Chats’, ‘graphy’ );

    else :
    _e( ‘Archives’, ‘graphy’ );

    endif;
    ?>
    </h1>
    <?php
    if ( $term_description = term_description() ) :
    printf( ‘<div class=”taxonomy-description”>%s</div>’, $term_description );
    elseif ( $author_description = get_the_author_meta( ‘description’ ) ) :
    printf( ‘<div class=”author-description”>%s</div>’, $author_description );
    endif;
    ?>
    </header><!– .page-header –>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php
    /* Include the Post-Format-specific template for the content.
    * If you want to override this in a child theme, then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );
    ?>

    <?php endwhile; ?>

    <?php graphy_paging_nav(); ?>

    <?php else : ?>

    <?php get_template_part( ‘content’, ‘none’ ); ?>

    <?php endif; ?>

    </main><!– #main –>
    </section><!– #primary –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    You should really post code between code blocks.

    The file you should look at is content.php. The loop is set to display the_content() unless we’re dealing with a search or a category, in with case it displays the_excerpt().

    Here:

    <?php if ( get_post_format() || 'content' == get_theme_mod( 'graphy_content' ) && ! ( is_search() || is_archive() ) ) : ?>

    So, in your child theme, change that file to best suit your needs.

    You would be better using a plugin for this (if one exists) as changing code can break your site. Also, when the theme updates, you will have to change the code again.

    I hope you don’t mind me asking, why do you want to display the full post on category pages?

    Thread Starter avaja

    (@avaja)

    WPMadeEasy,

    Thanks. Because my posts are really short (2 sentences/post). It doesn’t really make sense to further click to view the full content.

    Thread Starter avaja

    (@avaja)

    Thank you, WPRanger.

    I am really new to WP (2 days only). Sorry I don’t quite follow you. (For example, what is code block? what is child theme? :P)

    I saw that code you posted in content.php, but I dunno how to change that.

    I also saw in content.php the code “<div class=”entry-summary”>
    <?php the_excerpt(); ?>”

    Is there anywhere in archive.php that I could change it from displaying summary to full text?

    Many thanks!!

    That makes sense. Do you have a link to your site?

    That makes sense. Do you have a link to your site?

    @avaja

    A child theme inherits everything from its parent theme until you start changing things. It then differs from the parent by those changes. If the parent gets updated, the changes are not lost in the child. You can read about it here:

    https://codex.wordpress.org/Child_Themes

    So, make a child theme out of Graphy, swap to using that, then copy content.php from Graphy into the child theme. This will force WordPress to use the template from the child theme rather than the parent. Once done, edit content.php to change this:

    <?php if ( get_post_format() || 'content' == get_theme_mod( 'graphy_content' ) && ! ( is_search() || is_archive() ) ) : ?>

    to this:

    <?php if ( get_post_format() || 'content' == get_theme_mod( 'graphy_content' ) && ! ( is_search() ) ) : ?>

    Thread Starter avaja

    (@avaja)

    @wpranger

    That works! Thank you so much!!!

    Thread Starter avaja

    (@avaja)

    @wpmadeeasy

    I’m sorry I was told not to disclose our site before it’s done. Really appreciate your help!

    No worries. Glad your problem is resolved, good luck with your site.

    I love it when a plan comes together 🙂

    Thread Starter avaja

    (@avaja)

    Actually I was just trying to put certain posts on a specific page (or under a menu), then knew about the Category as Menu thing, then ran into the Full text issue with categories.

    If only WP can just let us choose the Page to put each post in!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to display full text article?’ is closed to new replies.