the_fear66
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Using in_category for all children categoriesHi Sivar
I think the theory is now perfect, but there seems to be a problem with the function returning the parent category. It currently returns a seemingly random value, of no relevance to the actual post.
The template idea is certainly an interesting one – i might have a look at that if we can get this function working.
Many thanks for any more help you can provide.
Matt
Forum: Themes and Templates
In reply to: Using in_category for all children categoriesHi Sivar
Thanks for that – I can certainly see the logic in how that would work. however I do have one further question – I have many categories and sub categories. Does this method allow me to pick and choose which ones with parents I am able to apply different templates to, or does this just say ‘anything with parent, no matter which parent, do this, otherwise do this’?
If so is there a way of tweaking it to say ‘if parent is $this then do this, else if parent is $this, do something else, otherwise do this’
Thanks
MattForum: Themes and Templates
In reply to: wp_list_categories shows children of childrenThat could work… but I use WP as a CMS and want my clients to be able to add categories at the lowest level from time to time. Therefore I was hoping to have it done dynamically, as it did in 2.0.
It would seem a shame for a nice feature like this to disappear in a new ‘improved’ version.
Cheers
MattForum: Fixing WordPress
In reply to: Sort (alphabetize) posts by custom fieldI’ve been a div – i realised it was actually much more sensible to store this extra data in the postmeta table… and lo and behold it now all seems to work.
Forum: Fixing WordPress
In reply to: Sort (alphabetize) posts by custom fieldThis method has worked really well for me in using a custom query from a new table I set up in the WordPress DB. However when I use the get_post_custom_value function I get an error.
my code looks like this:
<?php
$pageposts = $wpdb->get_results("SELECT *
FROM wp_posts, wp_users, wp_myart, wp_post2cat, wp_categories, wp_postmeta
WHERE wp_posts.id = wp_myart.post_id
AND wp_myart.user_id = wp_users.user_login
AND wp_posts.id = wp_post2cat.post_id
AND wp_post2cat.category_id = wp_categories.cat_id
AND wp_posts.id = wp_postmeta.post_id
AND wp_myart.user_id = '$user_login'
GROUP BY wp_myart.post_ID
ORDER BY wp_myart.date_added DESC");
?><?php if ($pageposts): ?>
<?php foreach ($pageposts as $post): ?>
<?php setup_postdata($post); ?><div class="myart">
<h3>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h3>
<img src="<?php the_excerpt_reloaded(); ?>" alt="<?php the_title(); ?>" />Price £<?php foreach (get_post_custom_values('Price (sterling)') as $value) {
echo $value; }?></div>
<?php endforeach; ?>
<?php endif; ?>
and the error doesn’t like the additional foreach by the looks of it. I can understand why it might – any other way of printing out this custom field??
Warning: Invalid argument supplied for foreach() in /home/interart/public_html/dev/wp-content/themes/default/my-art.php on line xxthanks all
MattForum: Fixing WordPress
In reply to: add posts to ‘wish list’< bump >
Forum: Fixing WordPress
In reply to: Create link to associated post in different categoryno idea – i think the mix of custom fields being used to link posts in different categories means the tags were rendered a bit useless, but I might be wrong.
Anyhoo, this works for me, so I’m happy.
Forum: Fixing WordPress
In reply to: Create link to associated post in different categoryIn case anyone is interested I managed to get this working like this:
<?php while (have_posts()) : the_post(); ?>
<?php
global $wpdb;
$artist_name = get_post_meta($post->ID, Artist, true);
$id = $wpdb->get_var(“SELECT wp_posts.ID FROM wp_posts, wp_postmeta, wp_post2cat WHERE wp_posts.ID = wp_postmeta.post_id AND wp_posts.ID = wp_post2cat.post_ID AND category_id = 3 AND wp_postmeta.meta_key = ‘Artist’ AND wp_postmeta.meta_value = ‘$artist_name'”);
$url = get_permalink($id);
?><div class=”item”>
<div class=”gallerypic”>
<div class=”desc”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></div>
<img width=”140″ height=”140″ src=”<?php the_excerpt_reloaded(); ?>” alt=”<?php the_title(); ?>” /></div>
<div class=”artist”>by “><?php echo $artist_name; ?></div>
</div><?php endwhile; ?>
Forum: Fixing WordPress
In reply to: Create link to associated post in different category^^ — ^^
Forum: Fixing WordPress
In reply to: registration form: adding additional form spacesHi
Does anyone know what bits of wp-register.php or registration-functions.php need to be edited to add a new field in? I thought it was straightforward but alas it doesn’t seem to be…
Cheers
MattForum: Everything else WordPress
In reply to: new sport site – performance questions…thanks for the reply katgirl
this is what makes me suspicious that the problem lies with the server. often the site loads quickly, but often it doesn’t… there doesn’t seem to be a consistent pattern.
can you tell me if you get any problems with loading times if you click into the focus sports links (on the left) and then into ‘performance sport’ or ‘recreational sport’? it would be great if you could try it for me on a couple of sports, particularly bobsleigh and basketball.
thanks
MattForum: Everything else WordPress
In reply to: new sport site – performance questions…Hmmm, i thought this had been resolved but I’m still experiencing speed problems after all. the homepage in particular is slow to load and still only displays after everything has loaded.
The deeper pages that seem to react slowly are those that have page lists displayed dynamically.
Anyone any more good ideas I should try? I’m running WP 2.0. It could well be a server issue but if the WP community can help me clarify this I would be very grateful.
Cheers
MattForum: Fixing WordPress
In reply to: Query custom fieldotto42 – you’re a beautiful man – it now works a treat. thanks very much.
Forum: Everything else WordPress
In reply to: new sport site – performance questions…Cheers for the heads up Yosemite. I’ve updated that, on the homepage at least, and it seems to me to have done the trick.
Forum: Fixing WordPress
In reply to: Restrict page edit to page authorAny more thoughts on this one? I have to confess i’m cheating here to get this post back to the top of the list. I’ve slapped my own wrist.
Matt