majestictreefrog
Forum Replies Created
-
Forum: Themes and Templates
In reply to: wp_list_bookmarks will not show category descriptionanybody?
Forum: Themes and Templates
In reply to: wp_list_bookmarks will not show category descriptionoh, and I should note that no images for the category have been defined.
areas where things could be going horribly wrong.
wordpress core, query.php.
When running the code above (and varieties such as testing the query after I merge with $newOrder) I have noticed that only SOME of the variable array seems to be successfully parsed and added to the DB query string.
I note that meta-key of post-order is queried correctly, but the orderby clause is not. The code where this is parsed is somewhere around line 2267 of query.php in wordpress core.
FINE. here is pastebin:
https://pastebin.com/QVpNeB4pcorrect DB query should be something like
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND (wp_term_relationships.term_taxonomy_id IN (25,70,71,72,73) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND wp_postmeta.meta_key = 'post-order' GROUP BY wp_posts.ID order by 0+wp_postmeta.meta_value
Forum: Themes and Templates
In reply to: find and display category nicenameActually, my issue turned out to be a bit more complicated. Each post has multiple categorys, and the category I want to display is a subcategory of another. Also, I did not know which order it would be returned.
What I DID know, for sure, was the parent category ID.
What I did was:
get the categories (all of them)
then loop until parent=(ID of correct parent category)
then pull the name from that iteration of the loop
breakForum: Themes and Templates
In reply to: display pages AND custom fields on front pagesolved it using “get_pages()” with the ‘child_of=’ modifier.
This works well. Also, I had to figure out what counts as ‘title’ by the get_page_by_title() method.
Thanks!
Forum: Themes and Templates
In reply to: theme similar to wordpresspaul,
what about the wordpress main-page theme appeals to you? There are lots of ways for things to be ‘similar’.
What are you trying to achieve?
Forum: Themes and Templates
In reply to: display pages AND custom fields on front pageoutput:
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Themes and Templates
In reply to: display pages AND custom fields on front pageIt did return objects/array… but of the 2 fake posts I made to the blog. Nothing page related.
The messed up part is that both of the posts have “post_parent” at 0…
for reference:
$my_wp_query=new WP_Query(); $all_wp_pages=$my_wp_query->query(array('post+type'=>'page'));//get all pages $student_bios=get_page_by_title('student-bios');//gets page as object $bios=get_page_children($student_bios->ID, $all_wp_pages); echo '<pre>'.print_r($bios,true).'</pre>';
Forum: Themes and Templates
In reply to: display pages AND custom fields on front pageEsmi,
Thanks!
Question though… it says it just returns ‘array’…. array of what? page objects? I need to go through each page and print stuff (just like the wordpress loop) but I’m not sure how to access the data in the returned array.