Support » Themes and Templates » Adding 'more' to the_excerpt in Mystique

  • Hi guys,

    I am so concerned this is going to be an irritatingly obvious answer, but I’m trying to add a ‘more’ link to my front page excerpts (at uberwensch.com) and I’m kind of stuck. I’m new to PHP so I’m not sure how much information is relevant, but you can skip to the bolded part to see the actual problem.

    So I’m using the Mystique theme, and I’ve gone in to Mystique settings > content and changed the post preview setting to ‘excerpt’, which solves some aesthetic problems I was having with clashing thumbnail and lead images when I posted. This posts the featured image connected to a post as a thumbnail, and runs the excerpt text alongside it. Perfect. I just want to add a little link that allows people to expand the post via its title/comments — this is how it is now — AND a “more” link.

    The problem is I can only see one section of code that makes sense to change, and I’ve changed it, and nothing happened.

    In the theme’s core.php settings, I changed this:

    if($post_settings[‘post_content_length’] == ‘f’): the_content(__(‘More >’,’mystique’));
    elseif($post_settings[‘post_content_length’] == ‘e’): the_excerpt();
    else:
    $word_count = $post_settings[‘post_content_length’]

    To this:

    if($post_settings[‘post_content_length’] == ‘f’): the_content(__(‘More >’,’mystique’));
    elseif($post_settings[‘post_content_length’] == ‘e’): the_excerpt(__(‘More’));
    else:
    $word_count = $post_settings[‘post_content_length’];

    That’s the best I can think to do, but there’s still no ‘More’ link.

    Any help would be greatly appreciated, and I apologise in advance if this is totally ridiculous. I did look around for answers before posting, I promise.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter uberwensch

    (@uberwensch)

    Bump.

    Thread Starter uberwensch

    (@uberwensch)

    I read all that stuff, and did as it specified, but it’s just not happening. It seems to me that all the infrastructure is there, but the ‘more’ tag is just not displaying.

    Thank you for responding though.

    Thread Starter uberwensch

    (@uberwensch)

    Maybe I’ve overlooked something obvious. There is a development in my situation! I took out all the bits and pieces I added and started again, by putting this:

    <?php
    function new_excerpt_more($more) {
    global $post;
    return ‘ID) . ‘”>’ . ‘[Go deeper…]’ . ‘‘;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    ?>

    In functions.php. It doesn’t change anything on the main index, but has changed the search result post previews (i.e. when I search for a tag) to display the manually-entered excerpt and the ‘read more’ tag/link.

    So, how do I make whatever change just occurred on the search results occur on the front page? The main index file doesn’t seem to have anything for me to change, because it just calls the post like this:

    if (have_posts()):
    while (have_posts()):
    the_post();
    mystique_post();
    endwhile;

    And the only other place I can think of that would be relevant is this, the core.php file.

    if($post_settings[‘post_content_length’] == ‘f’): the_content(__(‘More >’,’mystique’));
    elseif($post_settings[‘post_content_length’] == ‘e’): the_excerpt();
    else:
    $word_count = $post_settings[‘post_content_length’];

    As mentioned above, I have messed around with the post_settings stuff. I’m wondering if I should be adding a the_excerpt thing somewhere on the index.php

    I too have been wrestling with this for far too long, only to realize there’s a plugin out there that handles this problem and a number of other issues with excerpts very nicely:

    http://wordpress.org/extend/plugins/excerpt-editor/

    To customize the “Read More” after you’ve added the plugin and activated it, just go to Tools > Excerpt Editor > Auto-Generate and select the “Read More” button, then click on “Save Auto-Generate Options” – this will automatically add a “Read More” link after your excerpt or short posts.

    It will also allow you to have formatted excerpts, and you can customize the “Read More” text to include the title of the article. SO much help. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding 'more' to the_excerpt in Mystique’ is closed to new replies.