neilc
Forum Replies Created
-
Forum: Plugins
In reply to: Help with ‘Most Commented’ and post images plugin….Found the fix. I read through the mountains of comments left on the authors post for the plugin, and ‘Reid Beels’ suggested altering a ‘couple of the global calls’ at the top of the plugin file (didn’t say which exactly).
I’ve replaced these lines (51 & 52);
`global $post, $posts, $wp_version, $wpdb;
global $post_image_attachments;`With these;
`global $post, $wp_version, $wpdb, $wp_query;
global $post_image_attachments;if($wp_query->posts!=$posts)
$post_image_attachments=”;$posts = $wp_query->posts;`
As you’ve seen in my previous comment, I’ve been using
$imgposts = new WP_Query('showposts=5');
to pull up the ‘Recent Post’ images, whereas Reid Beel says that he usesquery_posts()
So I changed my calls to WordPress to use the following;
<?php query_posts('showposts=3'); ?> <?php while (have_posts()) : the_post(); ?> <ul class="recentposts"> <li class="recent_post clearfix" id="post-<?php the_ID(); ?>"> <div class="posttitle clearfix"> <a class="postimagelink" href="<?php the_permalink(); ?>"><img alt="Post icon" class="postimage" src="<?php post_image('/shared/images/post_default.jpg', false, false); ?>" width="35" height="35" /></a> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <p class="meta"> Posted <?php the_date('d-m-y'); ?> under <?php the_category(' & ') ?> | <?php comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)', 'commentlink', ''); ?> </div> </li> </ul> <?php endwhile; ?>
And if you check the ‘Recent Posts’ section on my homepage, https://dotneil.com you’ll see that all the icons and the commentlinks show! I’ve been working on this one for ages, so I’m very pleased!
Forum: Plugins
In reply to: Keeping the commentlink on all templatesAnyone have some ideas for fixing this?
Forum: Themes and Templates
In reply to: Using index.php as a parent page (why can’t do I do this?)I ended-up using the index template, creating pages, and hard coding a sub-nav for those pages into the index.
Looks like this;
<?php if(is_home() || is_search() || is_archive() || is_single() || is_page(‘Archives’) || is_page(‘Popular’)) { ?>
-
<li class=”page_item<?php if(is_home()){echo(‘ current_page_item’);} ?>”>Latest
<li class=”page_item<?php if(is_page(‘Archives’)){echo(‘ current_page_item’);} ?>”>Archives
<li class=”page_item<?php if(is_page(‘Popular’)){echo(‘ current_page_item’);} ?>”>Popular<?php } else {
$children = ($post->post_parent) ? wp_list_pages(‘title_li=&child_of=’.$post->post_parent.’&echo=0′) : wp_list_pages(‘title_li=&child_of=’.$post->ID.’&echo=0′);
if($children) { echo(‘- ‘.$children.’
‘); }
} ?>Forum: Plugins
In reply to: Sub-navigation for child pages (help needed)I’ve had some help from a guy over on WebDeveloper.com, and he’s made a script that shows the sub-pages for each of the main tabs (pages). This is great because is covers quite a few of my problems. The script he produced also gives the parent tab of each of the child pages a ‘current_page_parent’ class, which means that I can give main tabs a different CSS styling for when one of their child pages is selected.
I’m testing all this on test.dotneil.com, so you should be able to see my problems there.
However, I’m stuck with WordPress’ inability to add child pages to the main page, either home.php, or index.php. Am I missing something, or am right in making the assumption that the WordPress core just doesn’t facilitate sub-pages on the main page of the blog? I wanted to add sub-tabs (pages) on my main blog page, including ‘Archives’ and ‘Categories’, but WordPress doesn’t seem to want me to do this – I just don’t get the option to assign child pages to the main page. I only get the option to assign child pages to ‘pages’.
Does anyone know how to get around this? Any help would be much appreciated, I’ve nearly finished my dream blog!
Forum: Themes and Templates
In reply to: Fixing post navigation ‘prev’ and ‘next’ linksI just fixed this problem by trying some different styles on the chunky, blocky ‘Next’ and ‘Prev’ links. Check the stylesheet for the ‘div.postnav a’ styles.
It would’ve helped if WordPress would dynamically generate these ‘postnav’ links using a div, ul, or just some way of hooking on to each of the links (or if there is a way to do this, I haven’t found it!).
The PageNavi plugin is another option – you get a great page navigation system, and you can opt to have it always on, so that users know exactly where they are. I’ve used it on another site, and I’ll probably get round to putting it on WebAppropriate.com too.
Forum: Themes and Templates
In reply to: Fixing post navigation ‘prev’ and ‘next’ linksAny ideas on this one?
Forum: Plugins
In reply to: Sub-navigation for child pages (help needed)Thanks moshu – I’ll give that a look.