Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    I haven’t set up a walker class, but if you’ve got the post id, then you can retrieve the custom field values… it’s sorta more fallout from WP relying on global variables (ouch), but you may be able to use the general get_custom_field() function, or if not that, then I typically do this by using the GetPostsQuery class — I wrote that because I got so sick of WP’s caveats and limitations and disjointed interfaces in retrieving post data.

    You could do something like this, give you have the $post_id:

    $post = get_post_complete($post_id);
    
    print $post['my_custom_field'];

    Hope that helps.

    Thread Starter MaestroBasssolo

    (@maestrobasssolo)

    It took some time to get it going, but this fixed it. Somehow it was impossible to use the data inside a function inside the walker. So I copied everything in the walker itself and together with your code it’s working now. Not the prettiest solution, but the best for now.
    Thanks

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Glad you got it going. Sounds like it may have been a variable scoping problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘walker class’ is closed to new replies.