WordPress “include TEMPLATEPATH” or?

I built something like this: Index Container Widgets Area and I created a widget for that – Categories Widget – Index Container .php with this in: <?php include (TEMPLATEPATH . ‘/includes/containers/container-grid-categories.php’); ?> <?php ///include (TEMPLATEPATH . ‘/includes/containers/container-list-categories.php’); ?> and for example in the /includes/containers/container-grid-categories.php is this: <?php //include (TEMPLATEPATH . ‘/includes/containers/container-grid-categories/grid-thumbs.php’); ?> <?php include (TEMPLATEPATH … Read more

Dynamically load a JavaScript file

How can you reliably and dynamically load a JavaScript file? This will can be used to implement a module or component that when ‘initialized’ the component will dynamically load all needed JavaScript library scripts on demand. The client that uses the component isn’t required to load all the library script files (and manually insert <script> … Read more

Include file from higher level

I created a custom page template where I want to present some data specific for that page. The file is placed in wp-content/themes/themename/page-templates In that file I want to include another php file from the parent directory. That file is placed in: wp-content/themes/themename So in the file i write: <?php include(‘../Sorting.php’);?> But I receive an … Read more

Change title and meta description in included page (not template)

I’m trying to change title and meta description for pages used for products. The goal is to have the same effect as here: <script>document.title = “<?php echo $new_title; ?>”;</script> The page with lists of products is a template where are includes in some conditions. template_listing.php: if (!empty($offer[‘listingId’])) include(‘include_offer.php’); I’m struggling with how to change title/description … Read more