SimonJ
Forum Replies Created
-
Forum: Requests and Feedback
In reply to: Version 3.0 FeaturesOk, here are my suggestion.
I now only use wordpress Mu and I work as a web magazine director, just to say that I spend my whole days in the wordpress kitchen for years now… 🙂
[1] I totaly add my vote for the domain mapping feature for blogs.
[2] One thing I always wanted to have in wordpress Mu is a kind of “default settings interface” where you can adjust ALL the default settings for new blogs. By all I mean “all”, i.e. Media sizes, permalinks structure, etc.
[3] On the same topic, I always wanted to have an “update all blogs settings interface” where I can change all the settings for every blogs. Or better : a “check list” form where I can choose wich blog to update. Here again, by “all”, I mean All…
[4] Custom fields… I would like to have all the fields on the edit post screen once they are created, not in a drop down list… Or better, an option to choose if a custom field should always be visible outside the dropdown list.
I often use custom fields for differents information about an article that we always use (photo credit for instance)…
Or even better! A way to make some custom fields updated when we update post with no need to press the update custom field button itself.
And in my crazyest dreams, I would like to choose if a custom field should only be visible for the admin, and not for the authors!
[5] A “search all blogs” feature in wordpress itself, not in a plugin.
[6] A possibility to merge all the blogs, or some choosen blogs in a common RSS feed.
[7] Another attribute for blogs, not just “public”, “adult” and “spam”… I would like to have some kind of “club select”, for some featured blogs.
[8] Not so urgent in my point of view, but I think it will be important in a near future : A multi-database feature supported by auttomatic and the wordpress team.
===
Thats it. Keep on the good work. We choosed wordpress 5 years ago and I’m sure now we made the best possible choice for our web magazine.
@+
S.
Forum: Plugins
In reply to: “user” custom field?Thanks equalmark. I shall have a look at this. I’ll be right back with a review of these solution.
S.
Forum: Fixing WordPress
In reply to: Loop division and paginationSorry for the late feedback… I was out of town for holydays.
I tried to play with your idea, the code you wrote above gaves me a good start for some google.
Then, I found this article :
http://imod.co.za/2009/04/09/wordpress-place-something-after-only-the-most-recent-post/
The idea is to set the counter where you cass the “while have_posts” for the loop :
<?php while (have_posts()) : the_post(); $counter++; ?>Then, call what you want anywhere before the “endwhile” with an “if” statement based on a counter value :
<?php if ($counter == 2) : ?> <!--Do your stuff --> <?php endif ?> <?php endwhile; ?>Note the
($counter == 2)… Just change the number to adjust your need. In this example, you will display your stuff right after the second post…And it works with the pagination
Voilà …
S.
Forum: Plugins
In reply to: Robust Category Description / Sticky Posts@ evilnrj
Sorry if I took a month to get back to you… Don’t know if you will read this answer nor if you found the solution :
To use the actual category slug, just use “category_nicename” instead of “cat_name”… Like this :
<?php $category = get_the_category(''); $cat_slug = $category[0]->category_nicename; if (file_exists(TEMPLATEPATH. '/cat_description/'.$cat_slug.'.php') ) { include (TEMPLATEPATH . '/cat_description/'.$cat_slug.'.php'); } else { echo ''; } ?>S.
Forum: Fixing WordPress
In reply to: Query post to show one post per author ?I posted the solution I found, but after a last test, it did’nt work… So I edited my post… 🙂
But now, I think I found a solution… Seems to work…
Since I’m almost a php/sql analphabet, I didn’t understand very well your last answer, especially the first idea with “post__in”.
So here is what I did :
I made a function, on the same principle than “get_users_of_blog”…
function the_last_post_per_user(){ global $wpdb; $the_authors = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status='publish' AND post_type='post' AND post_author !='1' ORDER BY post_date DESC LIMIT 0,10"); return $the_authors; }I use the post table to retreive the authors Ids… this way, I’m able to order by post date… I made a “Select distinct” query to avoid duplication of post_author Ids…
Then, I use this function before the query you gave me yesterday, instead of “get_users_of_blog”… And I replace the
$bloguser->user_idby :$bloguser->post_author:<?php //get all users, iterate through users, query for one post for the user, //if there is a post then display the post title, author, content info $blogusers = the_last_post_per_user; if ($blogusers) { foreach ($blogusers as $bloguser) { $args = array( 'author' => $bloguser->post_author, 'showposts' => 1, 'caller_get_posts' => 1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { [...] endwhile; } } } ?>Seems to work, so far…
Do you have any opinion, or see any problem about this solution Michael? I would be glad if you can give me some feedback about it…
S.
Forum: Fixing WordPress
In reply to: Query post to show one post per author ?Hum… I posted a solution here, but obviously, I still have to scratch my head… 🙂
Sorry… 🙂
S.
Forum: Fixing WordPress
In reply to: Query post to show one post per author ?Hummm
One last question :
This query seems to always order the posts by author id…
Is there a solution to order by date ?
I tried
'orderby' => date,in $args with no succes…Thanks
S.
Forum: Fixing WordPress
In reply to: Query post to show one post per author ?Nice nice nice!
Exactly what I was looking for!
Thanks x 1000 MichaelH!
S.
Forum: Fixing WordPress
In reply to: Query post to show one post per author ?Ahhhh….
get_users_of_blog();!… Seems like the abracadabra I was looking for!I’ll give it a try and get back to you with feedback asap.
S.
Forum: Themes and Templates
In reply to: Display posts as thumbsOh… I just realised that I made a mistake in the first code above :
<?php $my_thumb = get_post_meta($post->ID, 'your_thumb_cutsom_field', true); if ($my_thumb == '') { echo ''; } else { echo '<img src="http://path/to/your/thumb/dir/"'.your_thumb_cutsom_field.'" alt="" />'; } ?>You must include your
http://path/to/your/thumb/dir/in the last echo…S.
Forum: Themes and Templates
In reply to: Display posts as thumbsOk, so If you upload manually your thumbs in a thumb folder via ftp, then, go for the custom field solution :
<?php $my_thumb = get_post_meta($post->ID, 'your_thumb_cutsom_field', true); if ($my_thumb == '') { echo ''; } else { echo '<img src="'.your_thumb_cutsom_field.'" alt="" />'; } ?>This code will look if there is a value in the custom field “your-thumb_custom_field”. If so, it will outbut the value in a “img src=…” html tag. If no it will output nothing.
So, in your_custom_field, you enter the name of the image file as a value when you write a post : thumb_image.jpg
Then, use this code within the loop to display all thumbs from a given category :
<?php query_posts('cat=XX'); ?> <?php while (have_posts()) : the_post(); ?> <?php $my_thumb = get_post_meta($post->ID, 'your_thumb_cutsom_field', true); if ($my_thumb == '') { echo ''; } else { echo '<img src="'.your_thumb_cutsom_field.'" alt="" />'; } ?> <?php endwhile; ?>—
If you do it manually, there is another possibility : to name your image/thumbs with the post-slug of the post and then output the slug in an img tag… This way, you don’t even need a custom field and it keeps your database light… I use it a lot, tell me so if you’re interested in such a function.
S.
Forum: Themes and Templates
In reply to: Display posts as thumbsmikejandreau :… And what will happens if your wordpress uploads are organized by dates ??… The uploaded images aren’t always in wp-content/, but by default in wp-content/year/month…
———————————
To display the thumbnail, or any size of the first attachment relative to a post, I don’t use a custom field
I use a function like this one. It looks for the first image relative to a post, uploaded via the write post panel:
function my_post_thumbnail() { global $wpdb; global $post; $post_thumbnail = $wpdb->get_var("SELECT ID FROM $wpdb->posts where post_parent= $post->ID and post_type = 'attachment'"); if ($post_thumbnail == 0) { echo ""; } else { echo wp_get_attachment_image($post_thumbnail, $size='thumbnail', $icon = false); } }This function will output the thumbnail in a html “img src=…” tag if there is an image attached to a the post, but nothing if there is no image…
Then, just use it as a simple template tag, in your loop wherever you want the thumbnail :
<?php my_post_thumbnail(); ?>To display thumbnails from posts in a specific category, just use query_posts :
http://codex.ww.wp.xz.cn/Template_Tags/query_posts
Something like :
<?php query_posts('cat=XX'); ?> <?php while (have_posts()) : the_post(); ?> <?php my_post_thumbnail(); ?> <?php endwhile; ?>Just adjust cat=XX with the ID of the category you want to display.
S.
Forum: Fixing WordPress
In reply to: Comments RSS feed from a specific category… Broken in 2.7Yeah. I made a ticket about this in the trac. Seems that it’s broken with the cat ID…
http://core.trac.ww.wp.xz.cn/ticket/9630
there is a workaround : it works with the category slug…
yourdomain.com/?cat=catname&feed=rss2&withcomments=1
Or…
yourdomain.com/comments/feed/?cat=catname&withcomments=1
Hope this help
S.
Forum: Fixing WordPress
In reply to: Get rid of header area?It’s not a wordpress wizard question… 🙂
It’s a CSS issue.
Did you read my post above ?
The content of your center column is in these three divs :
<div id=”content”>
<div class=”post”>
<div class=”entry”>And your sentence : “Welcome to JohnThomasMusic.org” is embeded in a <p> tag…
Then look in your style sheet… (style.css)
content : padding: 10px;
post : padding: 10px 0 10px 0;
p : padding: 10px 0 0 0;The first div (content) put a 10 px padding… the second div (post) add another 10 px padding inside the first one. Finally, the <p> tag add another 10 px padding…
So, starting from “content”, you end with a total of 30 px… About the space you have at the top I would guess… Your solution : adjust these value to get what you want.
Two principle about padding and margin to get you started :
1- when you have only one value, ie : padding: 10px : it means that the padding will be 10px on each side of the div (top, right, bottom, left)
2- When you have four value, ie : padding: 10px 0 10px 0 : it means that you have a different value for each side, starting at the top in clockwise direction : top right bottom left.
—
For instance, in your “post” div, you have : padding: 10px 0 10px 0;
It means : 10px top, 0px right, 10px bottom, 0px left.
Another example, your <p> tag :
padding: 10px 0 0 0;
It means 10px top, 0px right, 0px bottom, 0px left…
Finally, a last example, in your “content” div :
padding: 10px;
It means 10px padding for each side…
—
I suggest you to learn a little bit about CSS :
http://www.w3schools.com/Css/S.
Forum: Themes and Templates
In reply to: i can’t edit sidebarHum. From what I can tell, the content of this sidebar is defined by the widget section of your admin panel.
And it seems to me, if you look in your index.php, that everything after :
<div class="clear"></div> </div> <!-- /Content -->Is in footer.php…
(look in your html source… and compare with your index.php file…)
But… The footer of this theme is encoded. Is the second sidebar defined there? Could be possible…
I STRONGLY DISCOURAGE you to use this theme. DO NO USE themes with encoded footer.
Find another real free theme.
S.