wpnewbie80
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: HTTP 500 internal server error with wp-comments-post.php in IEthanks. I was kinda leaving that as a last resort though as it is a workaround rather than a solution to the original cause of the problem. It would require the eventual editor of the site (not me) to update the file each time they need to upgrade to a newer version of WordPress.
I really don’t understand what might be the cause though as it doesn’t seem to effect the majority.
Forum: Fixing WordPress
In reply to: BUG in 2.5.1 when posting blank commentI have exactly the same problem but changing the error messages to something long did not work. I’m completely stuck 🙁
Forum: Fixing WordPress
In reply to: HTTP 500 internal server error with wp-comments-post.php in IEsorry to bump, but has anyone got any idea how I can solve this?
Forum: Fixing WordPress
In reply to: Display a link back to the Parent Page underneathso sorry, I forgot to echo get_permalink
Forum: Fixing WordPress
In reply to: A more complex in_category check..is this possible?I have come up with this..it seems to work but I’m not sure if its luck or judgement! the function came from pointlessjon’s post
code is outside the main loop
$tempQuery = $wp_query; $currentId = $post->ID; $catToUse = ""; function post_child_of_cat($child_post_id, $parent_cat_id){ $cat_array = wp_get_post_categories($child_post_id); foreach ($cat_array as $category){ if (cat_is_ancestor_of((int)$parent_cat_id, (int)$category)){ global $catToUse; $catToUse = $category; return true; } } return false; } if ( ( $isAguide=in_category('16') ) || ( $needsAguide=post_child_of_cat($post->ID, 6) ) ){ if($needsAguide == true){ //the post is from a subject category and it needs a guidebook $GetTheGuideBook = new WP_Query(array('category__and'=>array(16,$catToUse))); //we know the guidebook post will be in category 16 and the current post's subject category if($GetTheGuideBook ->have_posts()) : while($GetTheGuideBook ->have_posts()) : $GetTheGuideBook ->the_post(); $guideBookPostID = $post->ID; $guideLink ='<a href="'. get_permalink() .'" title="' .the_title("", "", false). '">'. the_title("", "", false) .'</a>'; $guideImage = get_post_meta($post->ID, 'guideImage', $single ='true'); $guideName = get_post_meta($post->ID, 'guideName', $single ='true'); $guidePrice = get_post_meta($post->ID, 'guideAmount', $single ='true'); endwhile; endif; } } $wp_query = $tempQuery;Forum: Fixing WordPress
In reply to: A more complex in_category check..is this possible?thank you for replying.
category 5 is my ebook category. All categories that are a child of category 6 are subjects that an ebook is on.
an ebook post will also appear in one the subject categories, along with other posts.
Basically, when viewing a single post within category 5 ie an ebook, i want to display in a floated div, an image and paypal button for that ebook. On posts in a category that is a child of category 6…I want to show in a floated div the ebook for that ‘subject’ but instead of a paypal button, just show a link to the ebook’s post. I can do the necessary for the div / paypal but it is just how to work out which, if any, of the 2 options, I had to do, from within my single.php
If the post is in a category that is a child of 6, ie it is related to a particular subject, I will then have to get the necessary ebook’s info to display.
If that makes sense?
Forum: Fixing WordPress
In reply to: Code to have one category in a pageHello, I have been trying a similar thing..to list posts from a particular category on a Page. My reason for doing it this way is that my Page navigation is displayed via a plugin within a widgetized sidebar.
Would it still be possible to add a link to a particular category archive to appear within my navigation rather than a link to the Page?
thanks
j
I think I have the code to do what I’m wanting, but I’m a little unsure about the multiple loops involved and if I should be rewinding etc. Am I right in thinking that providing my intended output is to show the ‘guide book’ post,including the meta info, and then show the list of other posts below everything else, ie in my code it is after the initial endwhile, I can just use query_post again without the need to rewind etc?
Forum: Fixing WordPress
In reply to: Trouble only showing first level of pages in my sidebarI fixed it. my widgeted sidebar was over riding it