PZ5413
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to Create this LoopSo I’m really not sure if this is the best way to do it, but here’s how I managed to get it to work…
<?php query_posts('posts_per_page=1'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div id="featured-content"> <a href="<?php the_permalink(); ?>"> <h2><?php the_title(); ?></h2></a> <p><?php the_excerpt(); ?></p> </div> <div id="featured-image"><img src="<?php echo get_post_meta($post->ID, 'panoramic', true); ?>" /></div> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php query_posts('posts_per_page=1&offset=1'); ?> <?php while (have_posts()) : the_post(); ?> <div id="article-green"> <h3><?php the_title(); ?></h3> <img src="<?php bloginfo('template_directory') ?>/img/ArticlesSmall/fruit.jpg" alt="Fruit" /> <div class="readmore"><a href="#">Continue to Article »</a></div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php query_posts('posts_per_page=1&offset=2'); ?> <?php while (have_posts()) : the_post(); ?> <div id="article-red"> <h3><?php the_title(); ?></h3> <img src="<?php bloginfo('template_directory') ?>/img/ArticlesSmall/asiancouple.jpg" alt="Asian Couple" /> <div class="readmore"><a href="#">Continue to Article »</a></div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php query_posts('posts_per_page=1&offset=3'); ?> <?php while (have_posts()) : the_post(); ?> <div id="article-orange"> <h3><?php the_title(); ?></h3> <img src="<?php bloginfo('template_directory') ?>/img/ArticlesSmall/whitecouple.jpg" alt="White Couple" /> <div class="readmore"><a href="#">Continue to Article »</a></div> </div> <?php endwhile; ?> <?php endif; ?>
Forum: Fixing WordPress
In reply to: Exclude Feed from Redirect ListI have figured it out in case anyone else comes across this issue… WordPress has a conditional statement called “is_feed()”… just added that in like so:
if( !function_exists('forceRegistration') ) : function forceRegistration() { if( !is_user_logged_in() ) : if( !is_page(12) && !is_page(14) && !is_page(115) && !is_page(40) && !is_page(139) && !is_feed() ) : header("HTTP/1.1 302 Temporary Redirect"); header("Location:" . get_permalink(115) ); exit(); endif; endif; } add_action('template_redirect', 'forceRegistration'); endif;
and the site now allows anyone not logged in to access the feed as well ??
Forum: Fixing WordPress
In reply to: Monthly Archive for Custom Post TypeIs this not possible?
Forum: Fixing WordPress
In reply to: Page style based on TaxonomyOk so I setup a single-corenews.php file to display my custom post in a specific format… but now when I click the permalink for the post, it brings up the latest post that I made. I’m 100% sure this has something to do with the way I have it coded, but due to my little knowledge of php I’m unable to display it the way I want.
How should I setup my single.php page to properly show the full blog post when the permalink is clicked?
[code moderated - please follow https://codex.www.ads-software.com/Forum_Welcome#Posting_Code when posting code]
Forum: Fixing WordPress
In reply to: Page style based on TaxonomyThat’s what I was afraid of… ok next question …
Would the normal display of archive links by month work, or do I have to do something special to display the archives by month for the Taxonomy?
Forum: Fixing WordPress
In reply to: Stop WordPress Mangling Your Code fixYes sir, thank you very much.
I actually just deleted the functions.php file altogether as I didn’t have one before plugging in that code.