foochuck
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Loop Through Child PagesI found this solution:
<?php query_posts(array('showposts' => 20, 'post_parent' => 7, 'post_type' => 'page')); while (have_posts()) { the_post(); ?> <h2><?php the_title(); ?></h2> <?php } ?>However, how would I set post_parent to be the current page that’s using the template, instead of explicitly defining a page ID?
Forum: Fixing WordPress
In reply to: Control sort order when using wp_get_attachment_image ?I wanted to clarify that I only want to pull images on a specific page (this is being used in a page template). Will get_posts still work?
Forum: Fixing WordPress
In reply to: Control sort order when using wp_get_attachment_image ?Hello Christine,
The images are numbered in the order I want them to appear, but it’s have no effect for how they appear on my page. Here’s the code I’m using:
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Plugins
In reply to: [Instapress] Fatal Error [Plugin Instapress] Version 1.3.1I used this link:
http://www.leoganda.net/how-to-enable-xampp-ssl-socket-transport/
Please note that my php.ini didn’t have the following line in it:
;extension=php_openssl.dll
So I added the following to the dynamic extensions section of php.ini:
extension=php_openssl.dll
And that worked.
Forum: Plugins
In reply to: [Instapress] Fatal Error [Plugin Instapress] Version 1.3.1Nevermind that, I found the solution and now instapress works! 🙂
Forum: Plugins
In reply to: [Instapress] Fatal Error [Plugin Instapress] Version 1.3.1I’m having the same problem. I can’t find the openssl line in my php.ini to uncomment…
Forum: Fixing WordPress
In reply to: Blog pages show at mostI figured out the problem, my code was running outside of the loop. It’s been fixed. Thanks for your help!
Forum: Fixing WordPress
In reply to: Blog pages show at mostmfshearer72,
I noticed that shortly after posting this. I removed the code
&posts_per_page=-1– so now the page does only display 4 posts.However I can’t get the following code to show up:
<?php if ( $wp_query->max_num_pages > 1 ) : ?> <div id="nav-above" class="navigation"> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- #nav-above --> <?php endif; ?>Should I use something besides wp-query?
Forum: Fixing WordPress
In reply to: Conditional for parent categoryI was just printing out the array and saw that too…thanks very much!
Forum: Fixing WordPress
In reply to: Conditional for parent categoryYes, I did catch that the cat id was off. No luck on the single post pages yet…
Forum: Fixing WordPress
In reply to: Conditional for parent categoryPS – I did change the 20 to 23 in your code for single post as that’s the correct ID for my news category, however it’s still not working.
Forum: Fixing WordPress
In reply to: Conditional for parent categoryThat code works for the category pages, but not for the single post pages.
Forum: Fixing WordPress
In reply to: Conditional for parent categoryI should clarify, I’m using this in header.php but I need it to apply to single post pages, where you are seeing the permalink for a blog post.
I need it to detect if the article has the parent news category.
Forum: Fixing WordPress
In reply to: Conditional for parent categoryI’m using this in header.php so it will be global throughout all pages on my site.
Forum: Fixing WordPress
In reply to: Conditional for parent categoryesmi,
This is the code I’m using, however it’s not working correctly:
<h1 id="logo"> <?php $in_news = 0; // set a flag varable to false $cats = get_the_category(); foreach ( $cats as $cat ) { if( in_array( '23', get_ancestors( $cat, 'category' ) ) ) $in_news = 1; // set flag to true } if( $in_news == 1 || is_category(23)) : ?> <a href="http://localhost/test"><img width="345" height="176" src="http://localhost/test/wp-content/uploads/logo-old.png"></a> <?php else : ?> <a href="http://localhost/test"><img width="345" height="176" src="http://localhost/test/wp-content/uploads/logo.png"></a> <?php endif; ?> </h1>The else works on all pages. ‘is_category(23)’ works for the news page. However for all news sub categories, it’s showing logo.png instead of ‘logo-old.png’