WordPress.org

Forums

[resolved] links "page" - need help understanding... (9 posts)

  1. hsu0886
    Member
    Posted 9 years ago #

    Howdy,

    What I'd like to do is go into the WordPress admin console, create a page named "Links" and for the page text just put
    <?php get_links_list(); ?>
    Can someone tell me why this doesn't work?

    Your help is appreciated.

  2. moshu
    Member
    Posted 9 years ago #

    You cannot put php code in the content area - it will not run.
    What you can do:
    1. Create a Page template and use that to display your links
    2. Use a plugin like RunPHP or phpExe to be able to execute PHP code written in the content of posts and Pages.

  3. hsu0886
    Member
    Posted 9 years ago #

    Well, I tried RunPHP and got some weird errors... I'd like to try phpExe, but the download of the phpexec.txt is broken (I also tried to download his phpexec.php from his /wp-content/plugins folder, but I can't figure out how to download the php code and not get the parsing error "Fatal error: Call to undefined function:... yada") - anybody have the file on hand or know if it's hosted somewhere elsewhere?

  4. hsu0886
    Member
    Posted 9 years ago #

    ok, now i've been able to try php Exec... neither of these plugins worked for me though - php Exec did at least return echo statements and date queries, but I still can't call

    <?php get_links_list(); ?>

    and get my links. Is there something else I need write in the page editing area? I installed php Exec, and put the above code inbetween the [phpcode] [/phpcode] tags as required by the plugin, and I get nothing. If I try and add in the

    <?php require('./wp-blog-header.php'); ?>

    everything below the header disappears... so confused...

    I just want to have a page that pulls links using the get_links_list command... am I going about this the wrong way?

  5. moshu
    Member
    Posted 9 years ago #

    For me it's always the best to go by creating a new Page template - and you don't have to worry about running plugins etc. See the link in the first option in my post above.

  6. oriecat
    Member
    Posted 9 years ago #

    I agree. I have a links page for one category of links and it was easily made with a template.

  7. hsu0886
    Member
    Posted 9 years ago #

    Ok, I went with the template and I guess this time I had a better understanding of what I was doing - and it worked, marvelously, I might add. Thanks at all y'all for your help.

  8. moshu
    Member
    Posted 9 years ago #

    Glad it worked out. Could you, please, mark this topic as solved then?

  9. hsu0886
    Member
    Posted 9 years ago #

    yep.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags