Display pages from specific page template

Use get_post_field(‘post_content’, $product_page->ID ) to get the content outside loop. <?php $product_pages_args = array( ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘page_library_html.php’ ); $product_pages = get_pages( $product_pages_args ); ?> <?php foreach ( $product_pages as $product_page ) { echo ‘<div id=”posts” class=”flex_100″>’; echo ‘<div id=”library_title”><a href=”‘ . get_permalink( $product_page->ID ) . ‘”>’ . $product_page->post_title . ‘</a></div>’; echo ‘<div … Read more

Different image and background color depending on page type

I’ve used WordPress Conditional Tags to add a unique class or id to the containing div of the different page types. This could work well to change the background image/color for different types. Also, WordPress automatically adds a body class to the <body> tag for each page, so that could possibly be hooked into for … Read more

Daily posts like an archive

The function wp_get_archives as far as I know this will only output a list. Instead use the WordPress loop and WP Query’s Date parameters. For example to get yesterdays posts using WP_Query you can do something like: $yesterday = date(‘d.m.Y’,strtotime(“yesterday”)); $yesterdayarray = date_parse($yesterday); $query = new WP_Query( ‘&day=’ . $yesterdayarray[“day”] ); // grab the data … Read more

Trying to see if page is category or single and displaying title with appropriate heading tag

aha…white screen of death. I don’t know how I missed it. Your if statement lacks parenthesis. Try this: public function title() { if ( is_category() ) { echo ‘<h2 class=”post_title”>’; } else { echo ‘<h1 class=”post_title”>’; }; echo ‘<a href=”‘; the_permalink(); echo ‘” data-disqus-identifier=”‘; the_ID(); echo ‘”>’; the_title(); if ( is_category() ) { echo ‘</a></h2>’; … Read more