WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] permalink_anchor() Returns Nothing (5 posts)

  1. tryscer
    Member
    Posted 8 years ago #

    Hey,
    When I ask for permalink_anchor() (placed correctly within the Loop) from a Page template, it returns ''. I don't have any permalink customizations on. permalink_anchor(id) doesn't work either. get_permalink() put in the same place in the code work correctly.

    Any ideas?

    Thanks,
    J

  2. tryscer
    Member
    Posted 8 years ago #

    Also, if that helps -- I'm running WordPress 1.5 and this tag returns nothing on any kind of page, not just Pages.

  3. amory
    Member
    Posted 8 years ago #

    I don't know why permalink_anchor doesn't work for you. Is there any reason you couldn't just use <a href="<?php the_permalink(); ?>">permalink</a>? Or have you already tried that?

  4. tryscer
    Member
    Posted 8 years ago #

    Thanks for the reply. No, the_permalink won't work for me -- what I'm trying to do is to have under each Page the Pages it fathers. What I was trying to do is put

    '<?php wp_list_pages('title_li=&child_of=permalink_anchor()'); ?>'

    But that doesn't display anything. Next, I tried

    '<?php $var1 = permalink_anchor(); echo $var1; ?> '

    But that returns nothing just the same.

  5. tryscer
    Member
    Posted 8 years ago #

    Solved it!

    If anyone's interested -- I used $id instead of permalink_anchor and it works fine. Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic