Forums

Edit link for Page (4 posts)

  1. dragonsjaw
    Member
    Posted 2 years ago #

    I have a custom page template using a query post to pull a list of posts (title linkable)in a list.. works great.
    Setlists:
    link one
    link two

    I want to be able to edit this page with an edit link, but if I add:

    <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>

    I get edit links under each post title above...

    Is there a way to add an edit link to only edit the Page, not the links on the page?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the editable page content would be normally empty when using a page template.

    what do you want to edit, if you get an edit link for the page?

    you could simply go to 'dashboard' 'pages' and select the page to edit the content.

  3. dragonsjaw
    Member
    Posted 2 years ago #

    Yes I can edit the page from the dash, no big deal here was just wondering why.

    Thanks

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the reason why you don't get the edit link for the page is because with a page template you are running a custom query in the loop; and the original page query is not 'available'.

    if you really wanted/needed an edit link for the page, you would need to run a loop before the custom loop, or after the custom loop, after a 'wp_reset_query()' code.

Topic Closed

This topic has been closed to new replies.

About this Topic