taffeljohan
Forum Replies Created
-
Forum: Plugins
In reply to: WordPress 2.5 Share users table@hudatoriq: There are trac tickets here and here. The conclusion was that this is ‘broken’ on purpose to give you the ability to assign user capabilities on a per-blog basis even when the user tables are shared (something I am learning to appreciate as the number of blogs comprising the site I build and maintain grows). But allowing for definition of CUSTOM_CAPABILITIES_PREFIX in wp-config.php sounds to me like a good idea. Trac it!
Forum: Plugins
In reply to: WordPress 2.5 Share users tableForum: Plugins
In reply to: multiwp single signonI’ve written about this in a bit more detail here:
https://engine.taffel.se/2008/11/18/multiblog-single-login-in-wp-26/
Forum: Plugins
In reply to: How to turn ON/OFF links to my authors’ author.php pages?You have an extra semicolon at the end of your else block. You don’t end blocks with ;, just statements.
Forum: Plugins
In reply to: How to turn ON/OFF links to my authors’ author.php pages?Thanks Otto42, you beat me to it.
Forum: Plugins
In reply to: How to turn ON/OFF links to my authors’ author.php pages?I understood what you meant the first time. That’s what the code I posted above is supposed to do (your alternative 1). It checks to see if there is anything in the biographical info field using get_the_author_description() and only prints a link if there is. It is meant to be used on the posts page, of course, because if you were already on the author page, why would you want a link to that page?
Forum: Developing with WordPress
In reply to: query_posts in category with tagRight. The attachment being shown is chosen at random from those available, but you always have the same post coming up first. Try adding orderby=rand to the query argument.
In case you’re wondering what kind of loser would have this much time to spend on your problem the answer is a very bored loser in bed with a cold.
Forum: Developing with WordPress
In reply to: query_posts in category with tagThat’s because you have ‘showposts=1’ in your query. I thought that was on purpose.
Forum: Developing with WordPress
In reply to: query_posts in category with tagI think you need to set the ‘post_parent’ in the get_children() call. Since you’re not in the loop, it has no way of getting at the $post variable and uses the default 0, which means all images are retrieved.
Try adding
'post_parent'=>$post->ID
to the array you pass to get_children.Forum: Plugins
In reply to: How to turn ON/OFF links to my authors’ author.php pages?Doh! Sorry, my bad. I think the rest of what I wrote makes sense, though.
Forum: Developing with WordPress
In reply to: query_posts in category with tagWeird. I assume that you’re using the integer id for the category and not the name (otherwise you need to use category_name instead of cat).
What are you doing to get the attachments?
Forum: Plugins
In reply to: How to turn ON/OFF links to my authors’ author.php pages?is_author is meant for testing the role of the current user. It returns true if the currently logged in user has the author role. So (as I guess you realized) using it the way you tried to makes no sense.
I would try testing
get_the_author_description()
. Like this:$desc = get_the_author_description(); if ($desc!='') { // The description is not empty the_author_posts_link(); }
Forum: Fixing WordPress
In reply to: how to display urls???<?php echo parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); ?>
Forum: Plugins
In reply to: Add tagged posts to wordpress pageI take back that last correction! There is no query_posts method in WP_Query. I was right the first time.
Forum: Developing with WordPress
In reply to: query_posts in category with tagRight. WP_Query doesn’t have a query_posts method. I meant
$my_query->query();
So something like:
<?php function randomimage($size=medium,$num=1,$cat=0) { $my_query=new WP_Query(); $posts=$my_query->query('showposts=1&cat='.$cat); foreach( $posts as $post ) {
should do it…