How To: Simple domPDF Example

Seems as though I was attempting to perform this PDF creation too late in the lifecycle of the page. After adding this snippet to an action binding to init, it works perfectly.

Search through documents folder

get_bloginfo(‘template_directory’) returns a URI and I believe glob works with paths so try: $dir = get_theme_root() . “/documents/*”; foreach(glob($dir) as $file) { echo $file; }

WP Query conflict on tag.php and category.php template

Just in case anyone happens to run into this same problem, my round-about solution for taxonomy template query conflict: clone the main query NULL the query define new WP_Query re-instate cloned query Tested and working in header.php <?php global $wp_query; $temp_query = clone $wp_query; global $post; $temp_post = clone $post; $wp_query = NULL; $wp_query = … Read more

How to callback custom field text

Your text is already in the array $m_slider_custom, from this line: $m_slider_custom = get_post_custom($post->ID); If you just want the specific key feat_music you can use get_post_meta(): echo get_post_meta( $post->ID, ‘feat_music’, true ); Another, unrelated thing- I suggest spending some time with the Codex and cleaning up your URLs and paths. For example, this: get_option(‘siteurl’) . … Read more

dynamically filter by category via sub-menu

What you seem to be asking is relatively easy with a filter on pre_get_posts. function set_post_type_for_category_archive_wpse_101930($qry) { if ($qry->is_main_query() && $qry->is_category()) { $qry->set(‘post_type’, ‘news’); } } add_action(‘pre_get_posts’,’set_post_type_for_category_archive_wpse_101930′); That will hijack your entire category archive. That is why I asked if you “want to force your category archives to only show posts from the news post … Read more