dunkkan
Forum Replies Created
-
Forum: Plugins
In reply to: get_children for the current postAll is ok now. The question would be : why WP doesn’t works the linked images in a post as attachments ?
Anyway I mark this thred as resolved.
Forum: Plugins
In reply to: get_children for the current postOk I think that retrieving attachments works only with uploaded images/media π
I was linking images and pretending they were attachments. I’ll try it now and I’ll post back.
Forum: Plugins
In reply to: get_children for the current postThis would be for the images part, and I know I could change the post_mime_type to include any other file, but this isn’t even printing a simple image. π
<?php $images =& get_children( 'post_parent='. $post->ID.'&post_type=attachment&post_mime_type=image' ); ?> <?php echo wp_get_attachment_image( $image->ID ); ?>Forum: Plugins
In reply to: Querying posts Next Posts Link in IndexIt doesn’t seems to need the ‘&’ as a “connector”, maybe because there’s only one parameter : the offset ?
It’s in fact my main loop in
index.php, and the only special parameter would be that offset (before that, I have another loop with a wp_query).But don’t trust me, I’m not sure to do things totally right (even if the pagination works now), so any clarification would be cool.
Forum: Plugins
In reply to: Querying posts Next Posts Link in IndexAwesome !
Here’s my final code :
<?php query_posts ($query_string.'offset=1') ; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_excerpt(); ?> <?php endwhile; endif; ?>I just deleted the
&, which seemed to interfere in'&offset=1');.Many thanks.
Forum: Fixing WordPress
In reply to: wordpress caption injects css codeOk, sorry.
the ‘p’ tag which defines the text is under control now (I had some extra padding).
If you need to make smaller the whole caption (because if your original images are huge the caption will break all), just use the max-width, to the div:
div .wp-caption{ max-width:500px; }Forum: Plugins
In reply to: Why this counting posts system doesn’t work ?Here I found and easy, clean way too
<?php $mycats=get_categories ('include=14'); echo 'my cat count is '. $mycats[0]->category_count; ?>That’s working perfectly.
Forum: Themes and Templates
In reply to: paragraghs not spacingHi daisybee,
This must be something in the CSS. You can paste this at the end of your CSS stylesheet :
p { margin-top: 18px }Another cause can be that in the editor the <p>Text</p> tags are not correctly set, which happens sometimes when copy pasting text from here and there.
Forum: Plugins
In reply to: Quickest : wp_query or get_posts ?I’m retaking this tread
:)I’m playing locally with a WP install, and in my theme I’ve had the occasion to compare the two.
For me,
get_postsis having a faster loading.Is it my template ?
Here’s a diagram of myindex.php:get_posts(featured1)-------get_posts(featured2)-------get_posts(featured3) ----------a list : get_posts(again, simply the 10 last posts) --------There, I realised I could not control, from the Admin Panel, how many posts I was calling in the Index, without editing the template. They were always 10, and some future user wouldn’t like it, nor going to templating, so I went this way :
WP_query(featured1)-------WP_query(featured2)-------WP_query(featured3) ------------------------------a normal loop---------------------------Maybe it’s the quantity of WP_query I’m calling, but it’s a bit slower, and the images takes a bit more time than with
get_posts.If anyone have some idea why / how to improve it / confirm it / comment it … I’d like to optimize the template.
Thanks for any input,
Forum: Plugins
In reply to: retrieving cat ID via cat slugThanks !
Here’s the code I finished with :
<?php $category = get_cat_ID( 'Custom1'); $params = array( 'title_li' => '', 'include' => $category ); wp_list_categories($params); ?>The rest is some basic HTML and CSS to create an horizontal navbar, and the code repeats for each
div, changing the custom# category.Thanks Michael for that one.
Do you think there’s a better code to pass the params/print them ?
Forum: Fixing WordPress
In reply to: Display the Admin name/nicknameForum: Fixing WordPress
In reply to: Image Caption QuestionHi zukny, did you paste the code in the end of your style.css file ?
It’s important it be in the end of the file, just to overwrite any other styling code that can be affecting your posts.
Then, you must use Mozilla Firefox, which renders those rounded corners (IE still doesn’t do it).
With IE, you will get a standart corner, but the rest of the caption (clair-grey background, normal-grey border) should still be perfectly visible.
Forum: Fixing WordPress
In reply to: Subdomain plus subdirectoriesThanks Ornani, the lack of documentation was strange to me (because is an easy issue probably). Good to read some opinion though.
Forum: Fixing WordPress
In reply to: Subdomain plus subdirectoriesMaybe is impossible ? I’ve googled the matter and I’ve found really nothing, there’s only the discussion between choosing one or the other but nothing about a ‘mix’… (so yeah, bump)
Forum: Fixing WordPress
In reply to: Custom FieldsAn example of custom field :
<div class="loopinindex"> <!-- starting the loop --> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_title(); ?> <?php the_content(); ?> <!-- pulling the custom field --> <?php $music = get_post_meta($post->ID, "listening", true); ?> <!-- printing the custom field --> <?php echo $music ; ?> <?php endwhile; endif; ?> </div>listeningbeing the name of the custom field.
Hope that helps.