kz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: weird image display problemRelative path does not work.
Specify absolute path like this:
<img src="http://www.justchacha.com/images/foods/coffee2.jpg" />Forum: Fixing WordPress
In reply to: Japanese displaying as question marksplease share your solution.
Forum: Fixing WordPress
In reply to: Japanese displaying as question marksAdd Japanese fonts to font-family in style.css:
body{ font-family:"ヒラギノ角ゴ Pro W3","MS Pゴシック",Verdana,Helvetica,Arial,Geneva,sans-serif; }Forum: Fixing WordPress
In reply to: Is it possible to make a post be in sync under 2 catergoriesUse tags.
Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From Query<?php // sticky section $sticky=get_option('sticky_posts'); query_posts('p=' . $sticky[0]); /* do stuff */ wp_reset_query(); // main section global $wpdb; $posts = $wpdb->get_results (" SELECT * FROM $wpdb->posts WHERE post_status = 'publish' AND ID IN ( SELECT DISTINCT post_parent FROM $wpdb->posts WHERE post_parent > 0 AND post_type = 'attachment' AND post_mime_type IN ('image/jpeg', 'image/png') ) ORDER BY post_date DESC "); foreach($posts as $post) : setup_postdata($post); ?> <div> <span class="slider-text"> <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php echo slidertitle(get_the_title());?></a></h3> </span> <div class="slider-image"> <?php $images = get_children(array( 'post_parent' => get_the_id(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'ID', 'order' => 'ASC' )); $ids = array_keys($images); echo wp_get_attachment_image($ids[0]); ?> </div> </div> <?php endforeach; wp_reset_query(); ?>Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From Query3)Prepend sticky only loop.
$sticky=get_option('sticky_posts'); query_posts('p=' . $sticky[0]); /* do stuff */ wp_reset_query();Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From Query1)Use
<?php echo wp_get_attachment_image($attachment->ID); ?>
or
<img src="<?php echo wp_get_attachment_image_src()($attachment->ID); ?>" alt="" />
instead of
<img src="<?php echo wp_get_attachment_url($attachment->ID); ?>" alt="" />Forum: Fixing WordPress
In reply to: Disable paging on index frontpage like mydomain.com/page/2?if(! is_paged()) : /* your loops here */ else : <p>Nor found.</p> endif;Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From Query<?php global $wpdb; $posts = $wpdb->get_results (" SELECT * FROM $wpdb->posts WHERE post_status = 'publish' AND ID IN ( SELECT DISTINCT post_parent FROM $wpdb->posts WHERE post_parent > 0 AND post_type = 'attachment' AND post_mime_type IN ('image/jpeg', 'image/png') ) ORDER BY post_date DESC "); foreach($posts as $post) : setup_postdata($post); ?> <div> <span class="slider-text"> <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php echo slidertitle(get_the_title());?></a></h3> </span> <div class="slider-image"> <img src="<?php echo wp_get_attachment_url($attachment->ID); ?>" alt="" /> </div> </div> <?php endforeach; wp_reset_query(); ?>Forum: Fixing WordPress
In reply to: Gallery Tab Not Appearing…Try my response on No Gallery Tab!!
Forum: Fixing WordPress
In reply to: I only want to see ‘Parent’ pages in right sidebar,no ‘child’<?php wp_list_pages('depth=1'); ?>Forum: Themes and Templates
In reply to: How to dynamically get theme directory?Forum: Themes and Templates
In reply to: Changing Size of Font in Post1. style.css, line #161
2. font-size:3.6em;
3. font-size:2em; /* specify font size you want*/Forum: Fixing WordPress
In reply to: Remove image bordersChange
padding:5pxtopadding:0in your style.css like below:
.post img, .post a img {padding:0;}Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From QueryUse below code after
$attachments = get_posts($args);.if(count($attachments) > 0) : foreach($attachments as $attachment) : ?> <div> <span class="slider-text"> <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php echo slidertitle(get_the_title());?></a></h3> </span> <div class="slider-image"> <img src="<?php echo wp_get_attachment_url($attachment->ID); ?>" alt="" /> </div> </div> <?php endforeach; else : ?> <div> <span class="slider-text"> <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php echo slidertitle(get_the_title());?></a></h3> </span> </div> <?php endif; endwhile; endif; wp_reset_query(); ?>