• Resolved ed4becky

    (@ed4becky)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ed4becky

    (@ed4becky)

    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?

    Thread Starter ed4becky

    (@ed4becky)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Inside/Outside’ is closed to new replies.