Alex Cragg
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Sticky/Featured Post/Avoiding Duplicates@jvinch – I realise you posted that a long time ago, but maybe you are still following this thread.
@gmcdonough – I think I understand what you are saying, and I think I have a simpler way.Jvinch, why are you running two separate loops for you featured content? If you use your first loop to call two posts, then store their IDs in an array under do_not_duplicate, you can later call that array of IDs to exclude them from your second loop in the right column.
This is how I do it:
<?php $recent= new WP_Query('category_name=A-Feature&showposts=2'); while ($recent->have_posts()) : $recent->the_post(); $do_not_duplicate[] = get_the_ID();?> stuff <?php endwhile; ?>Then when you run your second loop, you search this array to find the IDs in it, and then the !== false makes sure that they are not used.
<?php query_posts('category_name=A&showposts=9'); ?> <?php while (have_posts()) : the_post(); if (array_search(get_the_ID(), $do_not_duplicate) !== false) continue; update_post_caches($posts); ?> stuff <?php endwhile; ?>Hope that works for you, let me know.
AlexForum: Plugins
In reply to: download plugin with loggin featureHave a look at WP E-Commerce.
It has a load of functions, including forcing people to log in to view the products, keeps a log of ‘purchases’, and the products can be downloadable files.
Alex
Forum: Fixing WordPress
In reply to: Showing previous and next posts in more detailI just replied to your other thread:
http://wordpress.org/support/topic/161913?replies=2Try not to post duplicates though!:-)
Forum: Plugins
In reply to: Change Registration Email ContentQuozt, check out my plugin: New User Email Setup
Forum: Developing with WordPress
In reply to: Adding text to the email sent when registeringJust to let you know that I have a plugin that performs this function(defining the registration email), which saves editing a core file(which should be avoided), you can find it here:
New User Email SetupForum: Developing with WordPress
In reply to: Second loop excerpt question………Have you read this page?
http://codex.wordpress.org/Template_Tags/get_postsThat seems to provide the answers, but I haven’t tried it myself,
let me know if that works.Forum: Developing with WordPress
In reply to: Showing the previous and next posts in fullAfter a few thoughts on this, I decided the easiest way would be the following:
open up link-template in wp-includes, and find the following:
function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true)This is the function that gets the next and previous post titles. I think prior to 2.5 it was called something else, maybe one of the next_post etc functions, but i might be wrong.
Now in that function find this:
if ( !$post ) return; $title = $post->post_title; if ( empty($post->post_title) ) $title = $previous ? __('Previous Post') : __('Next Post');If you change the two instances of
post_titletopost_contentyou will have the next and last content displayed.(I couldn’t get post_excerpt to work as I use the more tag, and didn’t have time to put in some text in the excerpt field to test any further)There are a few problems with this though, the content is not clickable to actually take you to that post, so you would need to use next_post_link to access the title, however, those functions just reference the one we just changed, so we can’t do that. The next step therefore (which I think I might do next week), is to turn this into a plugin, allowing you to define if you want the content, excerpt, or maybe get an image from that post, as well as having the title displayed.
Have a play and see what you think, I have a few other ideas(involving SQL queries), but this looks like the simplest.
Alex
Forum: Plugins
In reply to: How to GZIP my stylesheet and js using wp-super-cacheSo just to make sure I’m doing this right as this stuff is all new to me(I tried it and my jquery effects stopped working, but the gzipped version was served)…
In my main .htaccess, I have this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond .... ALL THE NORMAL WP SUPER CACHE CONDITIONS AND RULES <IfModule mod_rewrite.c> NORMAL WORDPRESS CONDITIONS HERE -f and -d ETC </IfModule> </IfModule> # END WordPressWhere do I put this new rule Otto? And do I include all of the IfModule part?
Also, when I used the 7zip compressor, I just used the default settings, but when I looked at the script panel of firebug, all I could see was 2 or 3 weird symbols, like G@ for example. Is that how it should appear…I’m guessing not?
Thanks again
Forum: Fixing WordPress
In reply to: Customize Activation Emailhey, I have a plugin to do this, my site is down at the mo, but check it out here on the extend section of this site.
Forum: Everything else WordPress
In reply to: Cannot access wp-adminThis appears to be a wider reaching problem, I was getting 500 errors on other domains on the same hosting. As i was about to move anyway, have started the process early.
Thanks, marked as resolved, hopefully it is.
Forum: Everything else WordPress
In reply to: Cannot access wp-adminhmmm, ok.
I just logged out of my account(my comp keeps me logged in) using a login form that I have in my sidebar.
The login form appears correctly now logged out, but if i try to login, i’m taken to a 404 on …/wp-admin
Forum: Everything else WordPress
In reply to: Cannot access wp-adminexactly the same, I get a 404.
I’m hoping this isn’t another attack (if you remember helping me before on that?)
Does the login page appear for you?
Thanks
Forum: Themes and Templates
In reply to: IE CSS problemsNo takers?
Forum: Fixing WordPress
In reply to: Conditional content in sidebar.php based on the_id()You want to be looking to use is_page() or is_single(), with the page/post id in the brackets.
Forum: Fixing WordPress
In reply to: Different design of category pages and content pagesThis is all perfectly possible.
Have a look here
http://codex.wordpress.org/Stepping_Into_Templates#Special_Template_Files
http://codex.wordpress.org/Template_Tags
http://codex.wordpress.org/Category_TemplatesIf you have any other question after reading that, just post back and we’ll do our best to help you out!