antistandard
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: use return instead of echo in shortcode function@brasofilo – this is only a snipet of code that I had first made to work in a template php file. Then I wanted to see if I could make it into a shortcode function and that is why it looks like it does not reference anything, but when the shortcode gets triggered, this shortcode block relates to other code inside the post/page that it sits in and seems to work fine. Thank you for that inquiry.
@alchymyth – I seem to remember you helping me once before. Thank you very much for your fix. IT WORKS! and now I can learn from you how to make that array output. Thanks again for your help and accuracy.
Forum: Fixing WordPress
In reply to: use return instead of echo in shortcode functionForum: Fixing WordPress
In reply to: WP-PageNavi showing same posts on all paginated pagesok great thanks, I’ll try it out when i get a chance and let you know how i go
Forum: Fixing WordPress
In reply to: Will pay for wordpress helpBy the way, before I close this post down, would you happen to know how to re-order the get_the_category() call so that it displays in an order I can set using a plugin such as ‘category order’ or ‘my category order’ ?
Thank you
Forum: Fixing WordPress
In reply to: wordpress list posts and categories related to each postIn addition I was hoping to also re-order the categories so they display in some manual way that I can set using a plugin or such.
Thank you
Forum: Fixing WordPress
In reply to: Will pay for wordpress helpOk Thanks Emil, I’ll head over to the link you gave me. Sorry to go against www.ads-software.com guidelines.
Forum: Fixing WordPress
In reply to: wordpress list posts and categories related to each postThanks Alchymyth, you know your php ??
It works well, here’s my code:
<? query_posts('cat=5&order=DESC'); if ( have_posts() ) : while ( have_posts() : the_post(); ?> <p class="whosrunning"><?php the_title(); ?></p> <?php foreach((get_the_category()) as $childcat) { if (cat_is_ancestor_of(9, $childcat)) { echo $childcat->cat_name; }} endwhile; else: echo "No members have events coming up at the moment"; endif; ?>
but do happen to know how I can modify this query to ONLY show posts that have category 9 cats associated with them?
in other words, if a post exists, but does not have any category 9 cats ticked in it’s edit screen, I don’t want to show it.
Thanks again for all your help
James
Forum: Fixing WordPress
In reply to: wordpress list posts and categories related to each postafter re-reading this question I thought it might sound confusing.
To make it easy to explain,
I want to list all the posts in a category.
Just say there are 3 posts in category ‘animals’
Now, with each of the 3 posts in ‘animals’ category, i want to show what categories they are associated with.
So, the first post in the ‘animals’ category might have ‘dogs’ and ‘fish’ associated with it.
and the second post might have the ‘fish’ ‘birds’ and ‘insects’ category associated with it.
so it would look like
Post title 1
– dogs category
– fish categoryPost title 3
– fish category
– birds category
– insect categorypost title 4
– birds category
– dog categoryAt the moment my code looks like:
<? query_posts('cat=5&order=DESC'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <p class="whosrunning"><?php the_title(); ?></p> <? wp_list_cats('child_of=9'); endwhile; else: echo "No members have events coming up at the moment"; endif; ?>
which lists all posts in the ‘animals’ category but unfortunately lists out all the categories which are children of animals.
what i want to happen is for the loop to look at each post individually and only show the categories that that particular post is associated with and then look at the next post etc etc.
Thank you for you time
James
Forum: Fixing WordPress
In reply to: get post custom keys -and- order by valueThanks again vtxyzzy,
I understand what you mean now.
If I was to then reverse sort the value instead of the keys, would i use:
natsort($custom_field_values);
$custom_field_values = array_reverse($custom_field_values,true);thank you for your time and help
-jamesForum: Fixing WordPress
In reply to: get post custom keys -and- order by valueHi vtxyzzy for your help.
I was lookiing and didn’t find any documentation on ‘rsort’ in the wordpress codex.
are there any parameters i can use with it to sort alphabetically, or by value ?
It would be perfect if I can sort the keys by value like in my example where the highest number (in the example 6 dragons) is first in the sorted output, then 3 bees and lastly 2 crocodiles.
hope that makes sense.
What I am trying to acheive is to sort the keys by using a number in the value field. So my client can put the highest number in the value for the key they want to appear first and so on..
Thanks for your help
Forum: Fixing WordPress
In reply to: Post list with their respective category names as headingsGreat, thanks. I tried that and the result was that it returned the sub cat title instead of the post title, but I found a different way to display the post title using custom fields.
Thanks again on your help. I really do appreciate it
James
Forum: Fixing WordPress
In reply to: Post list with their respective category names as headingsHi Alchymyth,
Thank you sooo much.
Your function worked really well as a base for what I am doing. I really appreciate your help and your code is excellent.
I had to edit a few things for formatting (of course) but the core code was perfect. Thank you !!
The only thing I could not work out was how to list the post title. When I used <? echo single_post_title(); ?>, it returned the sub cat title instead.
You have helped me more than enough with this so I don’t expect you to help me anymore, but ofcourse, if it is simple to solve I’d love to hear the solution.
Thanks again,
You rule
James
Forum: Fixing WordPress
In reply to: Post list with their respective category names as headingsHi alchymyth,
Thank you for the function.
I will try it this weekend and tell you how I go.
Thanks again,
James
Forum: Fixing WordPress
In reply to: Custom fields used like variablesHi Keesiemeijer,
Yes, that worked, thank you very much.
I didn’t need the lines:
// get all posts with a custom field key “name”
query_posts(‘meta_key=name’); ?>but everything else was perfect.
James
Forum: Fixing WordPress
In reply to: Custom fields used like variablesThanks mate, I’ll look at this later this weekend and let you know how I go.
Thanks again for your time,
James