• Hi all,

    I’m working on a new WordPress-Plugin that is going to export every single Post into a valid bookmark file (dont ask me what sense that makes ;)).

    So far i got this:

    $myposts = get_posts(‘numberposts=-1’);
    foreach($myposts as $post) {

    echo “$post->post_date “;

    }

    Which gives me a very simple list of all the dates of my posts. This is of course just some crappy code you can do nothing useful with, but i think you can get my problem better this way:

    Throuh the “$post->”-Object i have access to different variables related to the posts (eg. tags, ID). This works without problems but i need the “permalink” of the actual post beeing saved into an array.

    I can “echo” the permalink using the wp-function “the_permalink()” but i cant write this into a variable.

    Is there a way to save the permalink into an array whithin the foreach-loop?

    Sorry for my english, its not my native language

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Putting output of “the_permalink()” in a variable?’ is closed to new replies.