Cutline Theme Support Forums » Tips & Tricks

Add edit-link to each post

(8 posts)

  1. This is not really a mod, but quite helpful.
    I don't know if this is the right place to post this, if not, please move.

    This modification inserts an edit link next to the comments info, beneath the header of each posting.

    //open index.php with your favorite editor

    Search this:

    <h4><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> &middot; <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></h4>

    and replace it with:

    <h4><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> &middot; <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> &middot <?php edit_post_link('Edit', '', ''); ?></h4>

    now save and close the file, upload it to the right directory replacing the old file.

    Let's say, you've been blogging a while and can't remember how you've handled your blog without this cute edit link. You probably have recognized that the edit link is missing in the detailed post view. To fix this, read on...

    // open single.php with your favorite editor

    Search this:

    <h4><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> &middot; <a href="<?php the_permalink() ?>#comments"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a></h4>

    and replace it with:

    <h4><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> &middot; <a href="<?php the_permalink() ?>#comments"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a> &middot <?php edit_post_link('Edit', '', ''); ?></h4>

    now save and close the file, upload it to the right directory replacing the old file.

    Any problems? -tell me and i will do my best to support you.

    Posted 4 years ago #
  2. A german translation can be found here: http://www.dbsx.de/2007/09/04/modifikation-des-cutline-themes/

    Posted 4 years ago #
  3. Sweet entry dbs, I'll create a forum 'tips and tricks' for entries like these.

    Posted 4 years ago #
  4. This is exactly what I wanted! Well, I had already modified that section to add the time of day so I just carefully pasted in the edit_post_link section. It works perfectly.

    Note: the middot entity should end with a semicolon. It displays o.k. in my browsers, but entities usually begin with ampersands and conclude with semicolons, and if they're wrong, some browsers and readers can gag on them.

    Posted 4 years ago #
  5. Is there one that you can add to the comments as well. I liked the ability to edit a comment on my old theme without having to go back into wordpress.

    Posted 4 years ago #
  6. I wonder why it didn't just come like that. Did that myself and it makes things much easier

    Posted 4 years ago #
  7. Anyone want to suggest how to do this at the bottom of a post?
    Please?

    Posted 4 years ago #
  8. this is a great post thanks!

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.