astromono
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Filtering information with get_resultsAmaziiiing!
Dude, check it out! http://www.astromono.com/staff
I even managed to slap on the ORDER BY ASC from the previous code and it works!
`<?php
$excluded = “5,16,191,246,688,689”; // To exclude IDs 1,33,4
$sql = ‘SELECT DISTINCT post_author FROM ‘.$wpdb->posts. ” WHERE post_author NOT IN ($excluded) ORDER BY ID ASC”;
$authors = $wpdb->get_results($sql);
if($authors):
foreach($authors as $author):
?>`Forum: Fixing WordPress
In reply to: Filtering information with get_resultsThanks! I tried the new coding, but I still get all the authors posted, and this line of code jumped to the actual site:
SQL: SELECT DISTINCT post_author FROM wp_posts WHERE ID NOT IN (5,16,191,246,688,689)The line appears right before the get_results prints all auhors.
Forum: Fixing WordPress
In reply to: Filtering information with get_resultsThank you for the reply!
I tried declaring wpdb as global, but still no go. I even tried adding the <?php opening, but it doesn’t seem to be working.
Forum: Fixing WordPress
In reply to: Filtering information with get_resultsHmm… for some reason the filtering is not working now that I applied the code to a live page!
Hm… I’m trying to figure it out, but I don’t know what it is.
<?php $excluded = "5,16,191,246,688,689"; // To exclude IDs 1,33,4 $authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts. " WHERE ID NOT IN ($excluded)"); if($authors): foreach($authors as $author): ?>You can check it in action live here http://www.astromono.com/staff
Forum: Fixing WordPress
In reply to: Filtering information with get_resultsAwesome! Thank you so much, it worked like a charm!
The only thing was that I had to remove the ORDER BY ID ASC and add another parenthesis before the semi colon to wrap the thing.
Strangely, the authors are still organized the way I wanted to, so I’m golden.
Thank you!
Forum: Fixing WordPress
In reply to: Pagination with get_poststhanks! In the end I decided to stop being stubborn and just used get_query with an array. Thanks!
Forum: Fixing WordPress
In reply to: Custom Template for Specific CategoryThanks so much for the info!
I actually managed to display the loop for the specific category by doing this:
<div class="left"> <ul class="articles"> <?php if (have_posts()) : ?> <?php $thePosts = get_posts('category=13510'); foreach($thePosts as $post) : setup_postdata($post); ?> LOOP INFO HERE <?php endforeach; ?>Problem is, now I can’t seem to get pagination working properly for it. Help anyone?
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordOH! After a few hours of trying to get it to work, I figured “why not work backwards”? and this is what I came up with:
<?php if(get_wpn_config('featured_tag_id')) : ?> <div class="featured"> <div class="fthumbs"> <?php $i = 0; $featured = new WP_Query("tag=".get_wpn_config('featured_tag_id')."&showposts=4"); while($featured->have_posts()) : $featured->the_post();?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumbnail_top", true); ?>" alt="" <?php if($i == 0) echo 'class="active" '; ?>/></a><br /> <?php $i++; endwhile; $i = 0; ?> </div>Now if you look closely, the “featured_category_id” variable has been changed to “featured_tag_id”. This is because the custom control panel I had was made for categories. I went back in there and changed it to this:
<strong>Featured Tag:</strong> <p class="wpn_desc">Here you set the tag that you want to use for all of your featured posts. Any posts you want featured need to have this tag in order to be shown in the featured posts section.</p> <p><select name="featured_tag_id"> <option value="0" <?php if (!$options['featured_tag_id']) echo 'selected="selected"'; ?>>Disabled</option> <?php $tags = get_tags(); foreach($tags as $tag) : ?> <option value="<?php echo $tag->term_id; ?>" <?php if ($options['featured_tag_id'] == $tag->term_id) echo 'selected="selected"'; ?>><?php echo $tag->name; ?></option> <?php endforeach; ?> </select></p>The problem now is that even though I have the tag selected, its still not outputting any posts where it should. Like it’s totally ignoring the value stored in “featured_tag_id”.
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordSorry for the late reply, but unfortunately I wasn’t able to include the code provided into the loop successfully. I keep coming back to the header and trying to define a query that I can use like this:
$featured = new WP_Query("tag=cartelera&showposts=4"); <div class="featured"> <div class="fthumbs"> <?php if($featured->have_posts()) : ?> <?php $i = 0; while($featured->have_posts()) : $featured->the_post();?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <img src="<?php echo get_post_meta($post->ID, "thumbnail_top", true); ?>" alt="" <?php if($i == 0) echo 'class="active" '; ?>/></a><br /> <?php $i++; endwhile; $i = 0; ?> </div>I get a Call to a member function have_posts() on a non-object in /header.php on line 195
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordOh, thanks mrmist for clearing that up!
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordThank you so much for the reply, however I am a bit weary about putting the featured section inside the loop. As I have it at the moment it works on a separate section because it’s part of the header.
Maybe if I try taking off the second part of the code?
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordWeird, a user named thesheep made a reply to this. I got via email but it doesn’t show up here.
Forum: Fixing WordPress
In reply to: Featured posts by Tag KeywordThanks for the reply!
I checked and changed the function to has_tag, but still no go. I’m a bit confident that the issue lies with these two lines of code:
<?php if(is_tag('featured')) : ?>and
<?php $i = 0; $featured = new WP_Query("tag='featured'&showposts=4"); while($featured->have_posts()) : $featured->the_post();?>I honestly don’t know if I’m typing the second markup correctly. It’s supposed to check for posts that have the “featured” tag and output the last 4 posts with that tag keyword.
I was able to make it work with categories, but the markup for that is different:
<?php $i = 0; $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>Forum: Plugins
In reply to: [Plugin: Sociable] Image map completely off…@sociable: Thank you very much for the reply!
I checked on your advice to xerxy and was able to fix the issue by putting this simple rule in my main stylesheet:
.sociable a img {padding: 0;}
It just takes off any padding from image links belonging exclusively to the sociable class. I’m using an external sheet tho, but I think it will work if you put it in the one that comes with the plugin.
Hope this helps!
Forum: Plugins
In reply to: [Plugin: Sociable] Image map completely off…Same thing here, the image map on my icons seems moved or like the image isn’t the right size. You can check any individual post at http://www.astromono.com to see what I mean.
Any chance we can get help from the plugin developer?