Alkorr
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: One recent post per authorTara, the link provides an interesting code but then posts are ordered by author (alphabetically). Would it be possible to order them by date instead?
It tried ‘orderby’ => ‘date’ but it doesn’t work…
Any idea how to do that? Thanks!
Forum: Fixing WordPress
In reply to: Next/Previous Post Navigation within Parent CategoryGeez, I’m gonna close this topic, apparently there is NO solution to do it. Weird…
Forum: Plugins
In reply to: Display latest post of each authorI found this code but it still doesn’t do what I want. I would like to exclude some authors from the list and the order to be by the most recent published posts, not by post count.
Here is the code:
<div class="authorsContainer"> <?php //define vars from user selection $howManyAuthors = 50; //Get users and count of posts put into array $authorsArray=array(); $blogusers = get_users_of_blog(); if ($blogusers) { foreach ($blogusers as $bloguser) { $post_count = get_usernumposts($bloguser->user_id); $authorsArray[$bloguser->user_id]=$post_count; } arsort($authorsArray); $maxauthor = $howManyAuthors; $count=0; foreach ($authorsArray as $key => $value) { $count++; if ($count <= $maxauthor) { $user = get_userdata($key); $username = $user->user_login; $displayname = $user->display_name; $author_posts_url = get_author_posts_url($key); $post_count = $value; ?> <div class="topWriterBox"> <div class="topWriterName"> <a href="<?php echo $author_posts_url; ?>"><?php echo $displayname; ?> </a> </div> <div class="topWriterArticles"><?php echo __('Published: ', '').$post_count.__(' Articles', ''); ?></div> <br class="clr" /> <h4><?php _e('Latest Article:', ''); ?></h4> <ul> <?php $args=array( 'showposts'=>1, 'author'=>$user->ID, 'caller_get_posts'=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <!--============ THE AUTHORS ARTICLE DATA ================--> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permenent Link To <?php the_title_attribute(); ?>"><?php the_title(); ?></a> <small>(<?php the_time('m.d.y') ?></small>)</li> <?php endwhile; } ?> </ul> </div><!-- end of topWriterBox --> <?php } } } ?> </div>Thanks for your help!
Forum: Fixing WordPress
In reply to: How to display only one specific tag?Hi ddorr! I’ve found a way to do it within the loop, simple yet effective:
<?php if(has_tag(‘sometag’)){ ?>Some tag<?php } ?>
It works fine for me, hope it will help you! 🙂
Forum: Fixing WordPress
In reply to: How to display only one specific tag?I removed it, same result, blank page…
Just so you know, my main loop is this one below (you helped me about it a while ago, it worked fine to avoid duplicates but now it doesn’t work anymore, I don’t why, but it’s another matter):
<?php global $do_not_duplicate; ?> <?php $my_query = new WP_Query(array('posts_per_page' => 5, 'cat' => 1, 'post__not_in' => get_option( 'sticky_posts' )) ); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->ID; ?>Then:
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> <?php $all_the_tags = get_the_tags(); foreach($all_the_tags as $this_tag) { if ($this_tag->name == "sometag" ) { ?> <p>Name of my tag</p> <?php } else if ($this_tag->name == "someothertag" ) { ?> <p>Name of the other tag</p> <?php } else { // it's neither, do nothing ?> <!-- not tagged as one or the other --> <? } } } ?> <?php $i++; ?> <?php endwhile;?> <?php wp_reset_query(); ?>And that doesn’t work, blank page. 🙂
Forum: Fixing WordPress
In reply to: How to display only one specific tag?I’ve checked this page indeed, but when I add this code within my Query (where I want the tag to be displayed), I get a blank page…
<?php if ($all_the_tags); $all_the_tags = get_the_tags(); foreach($all_the_tags as $this_tag) { if ($this_tag->name == "sometag" ) { ?> <p>SOME HTML CODE <img src="someimage.jpg"></p> <?php } else if ($this_tag->name == "someothertag" ) { ?> <p>SOME OTHER HTML CODE <img src="someotherimage.jpg"></p> <?php } else { // it's neither, do nothing ?> <!-- not tagged as one or the other --> <? } } } ?>No idea why…
Hi Harish, thanks for your reply. I thought it would easier to do because it is ‘only’ some text to add when there is no count yet, to invite people to ‘like’ the post.
Unfortunately, I am not enough familiar with coding to edit your plugin. So I will use your great plugin as is. It works perfectly, my request was only aimed to make it even ‘better’, if possible 😉
Forum: Fixing WordPress
In reply to: How to display only one specific tag?Hi esmi 🙂
Because I only want one tag (the NBA (team) tag) to show on the front page, and on the single.php I want to display all the tags.
I want to use a tag, not create a taxonomy. That’s why I have to find a way to only show a specific tag when it’s there.
Great, thank you! 🙂
Any way to do that? Thanks for your help!
Hi there, any news from the author of the plugin? 🙂
Forum: Plugins
In reply to: [YOP Poll] Problem customizing .yop-poll-footer and bar colorAmazing, thank you so much!
In fact, your plugin is among the most complete I’ve ever seen. It is so fully customizable and has many options to configure but it’s great!
Thanks for your work and very quick replies! 🙂
Forum: Plugins
In reply to: [YOP Poll] Problem customizing .yop-poll-footer and bar colorThanks! I did what you explained, I chose No, selected the black color #00000 and saved the template but now I get a yellow bar:
<div id=”yop-poll-result-bar-div-2″ class=”yop-poll-result-bar-div-1″ style=”width:45%; height:10px; background-color:#FBD55E; border-style:solid; border-width:1px; border-color:#EDB918; “></div>
I didn’t set any yellow color anywhere and the #000000 has been correctly saved but it keep showing yellow?!
Weird, isn’t it?
Forum: Plugins
In reply to: Display latest post of each authorHi, does somebody have an idea how to do that? I’m clearly not alone trying to find how to do it, any help is welcome!
Ok, &new was the problem, I solved it!