jalacom
Forum Replies Created
-
Though I’m not sure what needs to be added to make it exclusively for the tag you selected
Forum: Themes and Templates
In reply to: Limit Tags displayedOk so i jumped the gun and found I didn’t know about the tag.php file. So i’m in the process of creating it. I’ve duplicated my index.php file and need to alter it for my tag.php file to return only the results of the tag that was clicked. How would I do that? Here’s the beginning of the index.php loop:
<?php $my_query = "showposts=5&cat=4"; $my_query = new WP_Query($my_query); ?><!-- Calls the main blogroll category --> <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?><!-- Starts the loop --> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Forum: Fixing WordPress
In reply to: Creating a Popular post with thumbnail sidebar itemSorry the link to my screenshot GTSB is incorrect. Here’s the correct link
GTSB poppostsProbably could use a loop like this
<?php $categories = get_categories('child_of=4'); foreach ($categories as $category) { echo '<h2>'.$cat_img.$category->name.'</h2>'; // start a list of posts echo '<ul>'; foreach (get_posts('orderby=post_date&category='.$category->term_id) as $post) { setup_postdata( $post ); // echo out the results into a list item echo '<li class="recipelist"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a>'. $speaker_name . $scripture.''; } // close the list echo '</ul>'; } ?>
Where it says
$categories = get_categories('child_of=4');
you’d change the number to the specific category number.Forum: Fixing WordPress
In reply to: display the number of posts using a tag in the sidebar?Ok so I got the answer on a different forum.
<?php // Select all the post tag IDs $the_tags = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'post_tag'" ); // Loop over each ID, and grab associated data foreach($the_tags as $tag_id) { // Get information on the post tag $post_tag = get_term( $tag_id, 'post_tag' ); // Print the tag name and count (how many posts have this tag) echo '<li><a href="'. get_tag_link($tag_id).'">'.$post_tag->name.' </a><span>('.$post_tag->count.')</span></li> '; // Unset the data when it's not needed unset($post_tag); } ?>
This creates a list out of my tags, links them and echos out the number of times the tag is used in posts. It works as I wanted, however I’ve been told that this is overkill and there’s a streamlined way built in to the WordPress API. I’m definitely open to going in that direction, just need to find which direction that is.
Forum: Fixing WordPress
In reply to: display the number of posts using a tag in the sidebar?Any body know how to do this? I’m trying and I’m quite sure i’m concatenating the content wrong.
This is the line I’m trying to edit into a list item and link:
echo $post_tag->name.' <span>('.$post_tag->count.')</span>';
I’ve done this (which of course isn’t working):
echo '<li><a href=\"<?php echo get_tag_link($tag_id); ?>\">'.$post_tag->name.' </a><span>('.$post_tag->count.')</span></li> ';
I obviously don’t know what I’m doing. Any help would be appreciated!
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Yurini,
Great thanks. That’s actually ideal to have it link to the article.I think the image needing to be reuploaded was the issue as you mentioned.
Is there a way to set just the width of a given size so the image will always be 560px wide? I’m not as concerned about the height. The problem I have is that currently I have the height set to 300px with the width at 560px, the resized image (since it’s not cropping) resizes to either 300px tall or 560px wide, which ever it hits first while resizing proportionally. One solution would be to just upload the correct dimension, however I’d like to make it a little more fool proof with less work for my client.
Thanks so much for your input. The a img link to the article is great.
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Ok fixed it using the codex link from above and referencing the Post Thumbnail Linking to Large Image Size section.
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Looks like it’s working! … mostly. I’m using
<?php the_post_thumbnail('large');?>
But I’m doing something wrong. I set the feature image as large (which i adjusted in Media to be 570 x 300, the height could be arbitrary, i’m not partial to it ) But after all that the image is sizing to 400×300. Not sure where that is being called and how to change it.Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Good to know. I’ll give this all a try. Thanks so much for the help
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Esmi,
Ok. I was thinking that was correct. I did it like this
<div class="entry-content"> <?php the_post_thumbnail('full');?> <?php the_excerpt(); ?> <p><a class="readmore" href="<?php echo get_permalink(); ?>"> Read More...</a></p> </div>
I saw that I need to add this <?php add_theme_support( $feature ); ?> to my functions.php file as well right? I have added it now….don’t have any errors this time so it should be good to go…I hope ?? Not getting any images showing yet. But that might be an issue with the sample image i currently have on the site.
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Yeah I’m going through it now. the problem I have with the “full documentation” is I’m not well versed in PHP to begin with so I end up pasting in code incorrectly. All the information i’m sure is there, but I’m not sure how to interpret it. I’m given the correct snippet but not the right place to put it. I’ve thrown quite a few errors, crashing the site in the process, because I placed something wrong in the functions.php file. I’ll be given a bit of code to place there, which is great, but i don’t know where to place it.
Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Esmi,
I’ll give it a shot. Reason for not using it? Because I’ve never heard of it. Let’s see what happens.Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Alchymyth,
yeah I tried that, and it works. However as I’m handing this site off to the client i want to make sure they’re not stretching their images.Forum: Fixing WordPress
In reply to: Include large full width image with the_excerpt()Thanks for the info.
I’ll try to figure this out. I don’t find the WordPress Codex as being all that easy to follow and understand. But again i’m not very well versed in most of this stuff.