Forums

[resolved] Inside/Outside (3 posts)

  1. ed4becky
    Member
    Posted 2 years ago #

    I have created a widget that takes a custom field and uses it to create a table of contents. Each TOC entry is a link to ???

    This is where I am looking for guidance. I want the link to pass a parameter, then use the parameter to generate dynamic content. The content is pulled from wp_posts, and I would like to just use the $wpdb library to retrieve the data.

    I am not sure how to go about this. If I call the php directly, won't I be bypassing the wordpress 'context' i.e. bypassing whatever controller WP uses to set things up? Or is 'global $wpdb' enough? I'd like this new 'page template' to be delivered as part of the widget/plugin instead of being theme specific, but be able to draw from the theme.

    Am I over thinking this?

  2. ed4becky
    Member
    Posted 2 years ago #

    An example is at jupiterthree.com Note the TOC entry in the second column. Right now it just goes to a php file that prints the parameter, but I want to access other WP features in building the 'real' content. Will I have access to the WP code in a 'normal' php file, or do I need it to go through a WP controller to set up the environment first?

  3. ed4becky
    Member
    Posted 2 years ago #

    I solved the issue by creating a page that uses a different template. I am able to use a std php _GET() within the template with no issues, and have access to all the WP functionality any page does.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.