Support » Installing WordPress » pulling page links from database

  • Attempting to pull the titles and the links of the pages within wordpress for a page outside the wordpress directory. Any help being able to display the links would be great.

    –> I guess I dropped this under installation instead of How-To, sorry.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If this “page outside the wordpress directory” is a PHP document, then you should be able to include the wp-blog-header.php file. An example of this is given for the 1.2 post loop info:

    Just make sure the path to it is correct. From then on you can use any of the WordPress functions/features.

    I placed the link and made sure the path was correct and it displayed nothing. I’m thinking it is because I’m running, if that’s not it then I have no idea. I was under the impression wp-blog-header.php displayed more than just the page links, which is all I want. I had orignally planned just to pull the page links directly from the database, without using the any of the wordpress files, but whichever is easier in the long run.

    — this is exactly what I need but I can’t get it to work. Any Help?

    wp_list_pages() is for listing WordPress Pages.

    Including wp-blog-header.php *enables* WordPress in a PHP document so that *any* WordPress function or feature can be put to use. If you’re trying to display Page links through wp_list_pages(), you do need to include wp-blog-header.php in your PHP page first. Otherwise you’ll have to write your own code that accesses the database, collects the info on the Pages, and then duplicates the functionality of wp_list_pages() in generating a list of links to them.

    If by including wp-blog-header.php you’re getting a blank (as in empty) page displayed, try this:

    define('WP_USE_THEMES', false);

    Making sure of course the path to wp-blog-header.php is correct.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pulling page links from database’ is closed to new replies.