mad_griffith
Forum Replies Created
-
Forum: Localhost Installs
In reply to: "Can't select database", but db is thereThen part of the error where it say “We were able to connect to the database server (which means your username and password is okay)” is not true?
Anyway, I created the password (username: root) and now it works. ??
Thanks for the advice, catacaustic.
Forum: Localhost Installs
In reply to: "Can't select database", but db is thereI only need it for local theme development. Not as an in-production environment.
As written in the error, pw and username seem fine. I really don’t understand what is going on since the db with that name exists.
Forum: Fixing WordPress
In reply to: Display past events only if no upcoming events existYou are probably right, but I wouldn’t know how to do the changes. Can you help?
This is what I am currently using to query the articles:
<?php query_posts('category_name=events&posts_per_page=8'); ?>
“Events” is the categories, which has several subcategories where the events actually belong to.
Forum: Fixing WordPress
In reply to: Display past events only if no upcoming events existit actually prints only past events, but it prints them EVEN THOUGH THERE ARE upcoming events. I want the past events to show up ONLY WHEN THERE ARE NO upcoming events.
EDIT: I also have events in subcategories. I noticed that the past events are printed not by date but by subcategory. So, if an event is more recent than another event, but belongs to a subcategory that has a higher index in the categories array, this most recent event will appear as less recent (= retrieved afterwards from the DB). Probably this can be solved by going back to the original problem: I would need to write an appropriate
elseif
, that I don’t know how to write.Forum: Fixing WordPress
In reply to: Display past events only if no upcoming events existI am currently using it without the
elseif
, in index.php and in archive.php, within the Loop. The output are normal posts that I turned into events by creating custom fields for them ($date_start and $date_end). They show up because they are considered upcoming, as I wrote in theif
clause.Forum: Fixing WordPress
In reply to: query_posts "posts_per_page" e "offset" conflicting?Thanks man, very interesting. I think I will switch to WP_Query, in the end, because I need to display all the posts from subcategories belonging to a certain subcategory. I will save this snippet though. Very useful.
Forum: Fixing WordPress
In reply to: Get_sidebar not working up on page.php?Forum: Fixing WordPress
In reply to: I don't manage to have "if have posts" workingThanks man, very clear!
Forum: Fixing WordPress
In reply to: Thumbnails automatic height and auto-cropthanks, it works.
Forum: Fixing WordPress
In reply to: get_post_ancestors ? how does it work?Thanks a lot, I tried to loop but was missing the get_post() bit.
Now I will try to add a link to it and then I will delve into echoing the child pages.
Forum: Fixing WordPress
In reply to: get_post_ancestors ? how does it work?I tried echoing the get_the_ID() function and it works.
But
<?php global $post; $parents = get_post_ancestors( get_the_ID() ); print_r($parents); ?>
prints
Array ( [0] => 30 )
I’d need to loop then, I believe.
Forum: Fixing WordPress
In reply to: get_post_ancestors ? how does it work?Yes, I made sure it was set through the page attribute before starting playing with this. Then I have find another way. Thanks a lot.
Forum: Fixing WordPress
In reply to: get_post_ancestors ? how does it work?Thanks David, but adding
print_r($parents)
only outputs
Array ()
p.s. I am using Enhanced text sidebar widget to embed the PHP code
Forum: Plugins
In reply to: [WP Category Sticky Posts] Not working in 3.5 with network modeWhich plugin does the same thing?
Forum: Networking WordPress
In reply to: Help redirecting domain2 to WPMU domain1ok, I am persuaded. Thank you!