Forums

Access to Page names and URLs (7 posts)

  1. ikaris
    Member
    Posted 4 years ago #

    Hello everyone,

    I'm trying really hard to find a way to access the names of Pages and their URLs, because I want to use something other than a list bullet.

    Following the trail of the code, I know that inside wp_list_pages() we have walk_page_tree(), and inside that there's Walker_Page, func_get_args(), and that's where I get lost.

    All I want is a an array with the names of the Pages and their URLs, so I can build a two column table to put a custom image and link side by side.

    Is this possible ?

    Thank you !

  2. ikaris
    Member
    Posted 4 years ago #

    Bump...

    no love ?

    Is this just not possible ?

  3. MichaelH
    Volunteer
    Posted 4 years ago #

    Maybe this:
    http://codex.wordpress.org/Template_Tags/query_posts#Retrieve_a_Particular_Page

    using something like:
    <?php query_posts('page_id>0'); ?>

    Then just use that along with the relevant The Loop code from the index.php in the default theme.

  4. Chris_K
    Member
    Posted 4 years ago #

    the default wp_list_pages does indeed generate an unordered list. But it certainly doesn't have to look like a list. If you look around at other themes, you'll see a lot of them have a page list that looks like tabs or other similar styles.

    Just takes a bit of CSS.

  5. ikaris
    Member
    Posted 4 years ago #

    MichaelH: Thank you, I took a look at that... however, there's nothing about getting an array of the names and URLs... any idea if thats possible ?

    HandySolo: Thanks to you as well, I have looked at a bunch of different CSS solutions and themes... however, I'm not sure how to do that so I can choose a different custom image for each link...

    My idea was to write a custom PHP function that looks for an image with the same name as the page (i.e., if I have a section called "Hello" it will look for an image called "Hello.jpg", and if it doesn't find one, it uses a default image.

    Is that possible with CSS ? I know there's the list-style-image property, but I don't think it can work that way... any ideas ?

  6. Chris_K
    Member
    Posted 4 years ago #

    Ahh... I totally missed the image aspect of your original post. Apologies for the somewhat useless response. I now understand what you're after, I'm just not sure how to do it.

    It sounds familiar though, have you done some searching here? I'm vaguely recalling a thread from last summer or fall.

  7. ikaris
    Member
    Posted 4 years ago #

    HandySolo:

    No problem, I probably should have been more descriptive!

    Yeah, the whole image thing seems to throw a wrench into the works :)

    Well, I'd say I've done my share of searches on Google, WordPress support, etc... but no dice.

    However, can you (or anyone else?) remember any of the keywords related to the post you're talking about ?

    Thanks !

Topic Closed

This topic has been closed to new replies.

About this Topic