the_post() in RSS feed

OK. So I think I figured this one out myself. I’ll document it here for the sake of those who may fall into the same trap. I’ve been using a template file to structure my feed. In my functions.php file, this is what the relevant portions of code looked like before: add_feed(‘weekly_deals’, ‘weekly_deals_create_feed’); function weekly_deals_create_feed(){ … Read more

wordpress – modifying template to show more posts

I think you can define posts number from Theme Options panel if so use ot_option(‘hp_mid_num’) as posts_per_page parameter to get more flexible query final code here <?php $wp_query = new WP_Query( array( ‘posts_per_page’ => ot_option( ‘hp_mid_num’ ), ‘cat’ => ot_option( ‘hp_mid_cat’ ), ‘paged’ => $paged ) ); ?>

WordPress function.php on ZendFramework CMS

This really has little to do with WP. Processing of that file is simple inclusion, I don’t see any complexity to it. Relevant code from WP core: // Load the functions for the active theme, for both parent and child theme if applicable. if ( ! defined( ‘WP_INSTALLING’ ) || ‘wp-activate.php’ === $pagenow ) { … Read more

Make Permalink go to specific template

Why not make your link include a parameter to change the way it loads the single.php page? <a href=”https://wordpress.stackexchange.com/questions/25008/<?php the_permalink(); ?>?audio-popup=1″>Link</a> Then in the single.php, you can do something like if ($_GET[‘audio-popup’] == 1) { include popup-player.php; return; } or similar to make it load that popup-player template instead. There’s other ways, but this is … Read more

Custom /Page/2/ Template Only

PHP has the $_SERVER[] variable, you can use this to get just about anything contained in the URL, you’ll probably want to look at PATH_INFO as a launching point. You can use strpos() (or, if you want to have better results, preg_match()) to check whether or not the string you get from $_SERVER[] contains the … Read more