Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter citizens4sbcc

    (@citizens4sbcc)

    OK, duh! I went ahead and inserted More links using the Visual interface and the original Posts show the complete text. Only in the News Page version do they have the “Read the rest of this entry ?” link, and that takes you to the original Post at the location of the tag. Slick! If we only do that on the few really long Posts, it will probably work fine.

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    Yeh, using the More tag would make for a clean site. Troubles are two: 1. I don’t want to manually tag every post the other volunteers make. 2. We don’t want every Post to have a more tag, but we DO want everything on the News Page to be in summary format. sigh…

    You’re right also of course about the perils of live editing, but again I don’t have ftp or any other access to the (ick) GoDaddy account this site is hosted on. Maybe I could get that, but having once futzed around with several static and dynamic (Drupal mostly) sites hosted by them, I’d prefer to just hide or leave town for a couple of months. ??

    I had an idiotic Aha moment realizing the bang is a NOT (!$post…) but my thick skull is still not allowing me to grok how this thing works. As you semi-predicted, swapping out the “<?php if…” line with yours produced a site-wide glitch:
    Parse error: syntax error, unexpected T_ENDWHILE in /home/content/91/5424091/html/CITIZENSFORSBCC/wordpress/wp-content/themes/graphene/loop.php on line 109
    Luckily I had another tab open in the browser with the editor window open on the loop file so I just changed it back and the site’s happy again.

    So far I’ve found several ways of making every Page/Post be excerpts, but no way of making only the News Page be so. I even tried turning off the Settings/Reading/Posts page: News option and inserting some code into the News Page, but of course that just displays the code without executing it.

    Guess there’s no way to get there from here, so thanks for your help and patience.

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    I tried your post_nice trick and it did nothing so I tried post_nicename and it worked on News, but again it just shows every Page and Post in mangled summary format so maybe I did it wrong. Here’s what I tried:

    <?php /* TEST FOR NEWS SUMMARIES */ ?>
    <?php if (!$post->post_nicename=='news' && !is_search() && !is_archive()) : ?>
    <?php the_excerpt(); ?>
    <?php else : ?>
                            <?php if (!is_search() && !is_archive()) : ?>
                            <?php the_content(__('Read the rest of this entry ?','graphene')); ?>
                            <?php else : ?>
                                <?php the_excerpt(); ?>
                            <?php endif; ?>
    <?php endif; ?>
    <?php /* END TEST */ ?>
    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    I wonder if Graphene already has a nice way to format excerpts, and I just haven’t found where to turn it on. Near the end of the functions.php file there’s this:

    if (!function_exists('graphene_continue_reading_link')) :
        function graphene_continue_reading_link() {
            return ' <a href="'. get_permalink() . '">' . __( 'Continue reading ?', 'graphene' ) . '</a>';
        }
    endif;
    
    /**
     * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and graphene_continue_reading_link().
     * Based on the function from Twenty Ten theme.
     *
     * To override this in a child theme, remove the filter and add your own
     * function tied to the excerpt_more filter hook.
     *
     * @since Graphene 1.0.8
     * @return string An ellipsis
     */
    function graphene_auto_excerpt_more( $more ) {
        return '…' . graphene_continue_reading_link();
    }
    add_filter('excerpt_more', 'graphene_auto_excerpt_more' );

    OK, I’ve searched every imaginable file on the string “excerpt” and don’t find a place where the_excerpt is defined. I guess either it’s a PHP function or is in a file I can’t access via the WordPress Appearance/Editor admin screen. So maybe I can replace the_excerpt with excerpt_more or with graphene_auto_excerpt_more in the code snippet above to get better formatting? Am I totally lost?

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    I’ll try to figure out what file post_name is in and what it does, and meanwhile it’s been years since any programming so I’m wondering if the final code excerpt would look like this:

    <?php /* Post content */ ?>
                        <div class="entry-content clearfix">
     <?php if (!$post->post_name=='news' && !is_search() && !is_archive()) : ?>
     <?php the_excerpt(); ?>
     <?php else : ?>
                            <?php if (!is_search() && !is_archive()) : ?>
                            <?php the_content(__('Read the rest of this entry ?','graphene')); ?>
                            <?php else : ?>
                                <?php the_excerpt(); ?>
                            <?php endif; ?>
     <?php endif; ?>

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    Adeptris, we’re definitely in the ballpark! Doing as you suggest did in fact create a “Continue Reading” prompt on the News Page. Two downsides though: 1. It munges all the excerpt text together, wiping out all formatting so it’s all but impossible to read. 2. It does the same to EVERY Page and Post on the site.

    Can it be that my problem has to do with this being a conditional if/then? Here’s the surrounding code in the loop.php file:

    <?php /* Post content */ ?>
                        <div class="entry-content clearfix">
                            <?php if (!is_search() && !is_archive()) : ?>
                            <?php the_content(__('Read the rest of this entry &raquo;','graphene')); ?>
                            <?php else : ?>
                                <?php the_excerpt(); ?>
                            <?php endif; ?>

    Do I need another if/then to turn off the Graphene line as you did but ONLY for the News Page (WP Posts Page), and then add in that “the_content” line in the index.php file? Then some other code to restore the Post formatting in the excerpts?

    Sure seems like this is a problem specific to the Graphene theme, so I’ve posted a query on the new forum there too but so far no reply.

    Thanks for your help! You’ve given me hope of eventually figuring this out, and then I can post the solution on both forums so others can gain this functionality.

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    Noticed that the two strings I tried started with “</” and the ones in the index.php start with “<?” so I tried again with that and still no joy.

    Thread Starter citizens4sbcc

    (@citizens4sbcc)

    Cool to get your help so fast! Makes sense to me, but I’m concerned that doing this would make for “More…” tags on every Page & Post. Also, that “the_…” string’s not in the index.php file in this theme (Graphene 1.0). Aside from comments, just these three lines:
    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I went ahead and tried adding this to the bottom of the index.php file:
    </php the_excerpt();?>
    No difference. I then tried this:
    </php get_excerpt();?>
    No difference.

    Ideas?

Viewing 8 replies - 1 through 8 (of 8 total)