stevoweb
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: transient_feed is getting scary. Is it legit , have I been hacked?Thanks cc.
Forum: Fixing WordPress
In reply to: transient_feed is getting scary. Is it legit , have I been hacked?Is anyone able to shed any light on the above questions? I’d like to know a bit more about this too. Thanks.
Forum: Fixing WordPress
In reply to: List posts that were tagged with a certain keywordDone it!! Thanks all. I didn’t know you could have an array in an array like that. I just needed to add that tag_slug__in property that you mentioned Big Bagel.
Full working code:
<?php $args = array( 'numberposts' => 5, 'order'=> 'DESC', 'orderby' => 'post_date', 'tag_slug__in' => array( 'hotposts' ) ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <?php the_time('F j, Y'); ?> <a href="<?php echo get_permalink(); ?>"> <?php the_title(); ?> </a> <?php the_excerpt(); ?> <?php endforeach; ?>
Forum: Fixing WordPress
In reply to: List posts that were tagged with a certain keyword(Sorry Big Bagel, only just noticed your post. Will look at it now.)
Forum: Fixing WordPress
In reply to: List posts that were tagged with a certain keywordJust to summarise:
I can list the latest 5 posts using the code in my original forum post above.
Separately, I can list ALL posts tagged with a certain keyword (hotpost) using this…
<?php $the_query = new WP_Query( 'tag=hotpost' ); while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php the_time('F j, Y'); ?> <a href="<?php echo get_permalink(); ?>"> <?php the_title(); ?> </a> <?php the_excerpt(); ?> <?php endwhile; wp_reset_postdata(); ?>
What I can’t work out is how to combine these two snippets.
- The first code snippet, which uses a foreach loop, lists the five most recent posts but doesn’t filter by tag.
- The second code snippet (above), which uses a while loop, filters by tag but doesn’t restrict the number of posts to five.
(As you can probably tell I’m no natural coder, so apologies if the solution to this is obvious!)
Forum: Fixing WordPress
In reply to: List posts that were tagged with a certain keywordThanks alchymyth. I have been fiddling around with WP_Query for ages but can’t work out how to combine it with what I’ve done so far – for some reason it’s not working.
This is all going in a copy of page.php which I’m using as my static front page, if that’s any help.
Forum: Plugins
In reply to: [Fast Secure Contact Form] [Plugin: Fast Secure Contact Form] Email from:This issue had me stumped for a little while because I had turned off all the standard fields and had configured my own name field (called ‘Your name’) as an extra field. I didn’t realise that for the form-filler’s name (as opposed to the text ‘WordPress’) to display in the site owner’s From: column in their email client, we had to make use of the plugin’s standard Name field. But that’s not a problem. I just noticed that the standard form fields and labels can be styled with classes in the Style section, matching up with any classes entered in the extra fields, so all is good.
By the way, superb plugin Mike.