Forums

[resolved] Edit Post in Archive? (8 posts)

  1. stew278
    Member
    Posted 6 years ago #

    Does anyone know if it possible to have the edit_post_link tag work in an Archives template? I have had no luck putting it in and would appreciate anyone's help.

    btw: yes, I've placed it within the Loop, but no luck.

  2. moshu
    Member
    Posted 6 years ago #

    What do you call an Archives template?
    archive.php - yes.
    archives.php - (which is a Page template BTW listing months and categories) no.

  3. stew278
    Member
    Posted 6 years ago #

    In 2.0, it's archive.php ...

    Can you explain how to, moshu? Thnx.

  4. moshu
    Member
    Posted 6 years ago #

    What do you mean "how to"? It just has to be inserted in the template file.
    Whether it's archive.php or archives.php - that depends on the theme, not the WP version. Some themes have one of them, others none of them... and some both :)
    Which theme?

    Can't you just look at how it is inserted in the index.php and copy the code into your archive template?

  5. stew278
    Member
    Posted 6 years ago #

    Nope; I've been trying that and I get Parse error: parse error, unexpected '}' ...

    Here's what I am using:

    <?php } edit_post_link('<img src="'.get_bloginfo(template_directory).'/images/icon_edit.gif" alt="Edit Link" />','<span class="editlink">','</span>'); ?>

    ... which is working in the single.php template.

  6. moshu
    Member
    Posted 6 years ago #

    I don't have such a code. Which theme?

  7. stew278
    Member
    Posted 6 years ago #

    Was a modified one I believe from Kubrick theme. Was searching and found someone who had modified the edit_post_link to display an image/icon instead of the text, Edit Entry

    I have just figured it out though ... what seems to have been the problem was the } right after the <?php ... I deleted that and now it works in my index.php file, but I need it there to work on the single.php file ..........

    Weird, huh?

  8. moshu
    Member
    Posted 6 years ago #

    One line of code taken out of context might seem "weird" but probably it was part of a bigger picture :)

Topic Closed

This topic has been closed to new replies.

About this Topic