3stripe
Forum Replies Created
-
Forum: Plugins
In reply to: Pull latest attachment from post?Got it!
<?php global $wpdb; $attachment_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_status = 'inherit' AND post_type='attachment' ORDER BY post_date DESC LIMIT 1"); ?> <?php if ($attachment_id) echo '<a href=' . wp_get_attachment_url($attachment_id) . '>Download</a>'; ?>
Forum: Plugins
In reply to: Pull latest attachment from post?Thanks for the pointers on this thread, really helpful!
I am trying to display a link to the first attached mp3 on a post, but so that it says simply ‘Download’, not the actual title/filename of the mp3…
But none of the above allow this as far as I can tell?
I could change the name of every mp3 to ‘Download’ but that seems a hack too far! ??
Forum: Everything else WordPress
In reply to: User statusI’m looking for the same thing, I’d like to display just a single user’s own status on a profile page….?
Forum: Plugins
In reply to: [Plugin request] Add a user as a friendOh thanks for the link, looks like it’s for WordPress MU though, still might be useful though I guess ??
Forum: Plugins
In reply to: [Plugin request] Add a user as a friendlol, i can’t build it myself or i would… i was hoping it was already out there already but as far as I can tell there’s nothing existing!
Forum: Themes and Templates
In reply to: Custom Admin Post page – what’s easiest?^ that is perfect for the job!
I was about to ask the same question ??
Check out https://svn.automattic.com/wpcom-themes/prologue/post-form.php for a template to create your post page!
Forum: Fixing WordPress
In reply to: in_category not workingFound an easy fix ??
if (!is_page() && (is_child('Blog') || in_category('1')))
Forum: Fixing WordPress
In reply to: in_category not workingIt’s like the other pages think they are in_category(‘1’) ????
edit – confirmed, if I put the below on a static page, the output is ‘Blog’
foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; }
Forum: Fixing WordPress
In reply to: in_category not workingHello folks, been a while since I was on here! (Liking the new 2.5 Admin theme a lot)
I have a similar problem – my blog template is incorrectly being applied to every page. I’ve double checked the category ids and that the is_child plugin is working… but… no luck…
Any ideas?
Here is my index.php page:
<?php $post = $wp_query->post; if (is_child('Blog') || in_category('1')) { // if blog article, use single page blog template include(TEMPLATEPATH . '/index_blog.php'); } else if(strstr($post->post_content,'<!--more-->')) { // else if more tag found, use 2 column splitter layout include(TEMPLATEPATH . '/index_image.php'); } else { // otherwise use default 1 column layout include(TEMPLATEPATH . '/index_default.php'); } ?>
As suggested above I’ve also tried:
<?php if ( have_posts() ) { the_post(); rewind_posts(); } if (is_child('Blog') || in_category('1')) { // if blog article, use single page blog template include(TEMPLATEPATH . '/index_blog.php'); } else if(strstr($post->post_content,'<!--more-->')) { // else if more tag found, use 2 column splitter layout include(TEMPLATEPATH . '/index_image.php'); } else { // otherwise use default 1 column layout include(TEMPLATEPATH . '/index_default.php'); } ?>
Forum: Fixing WordPress
In reply to: Permissions/problems uploading imagesAnyone using Plesk 8 should have an option to set safe mode on/off buried in the settings tab of your domain:
Domains -> Setup -> Services
Worked for me straight away without having to restart ??
Forum: Alpha/Beta/RC
In reply to: Improved Thumbnail QualityI can’t believe this has been added to the core yet.
Why is it ALWAYS so hard to efficiently manage images with WordPress… things are getting better, but so slowly!
Forum: Fixing WordPress
In reply to: How to link to an empty search page?Or, how can I modify the search form, so that it only submits if the input textarea has something in it!? Maybe that would be easier…
(Sorry for talking to myself)
Forum: Fixing WordPress
In reply to: How to link to an empty search page?I have just realised, it’s not actually showing an empty page when I goto myblog/search/, it’s trying to load a 404 page, which I didn’t have defined in my style.
So including a search box on my 404 page helps a good deal!
The problem is, you are still taken to myblog/?s= if you then leave the search box blank, and hit enter.
Is there a way to define this redirect action?
Maybe it is actually the nice-search plugin that needs some extra code?
function txfx_nice_search() { if ( is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false ) { wp_redirect(get_bloginfo('home') . '/search/' . str_replace(' ', '+', str_replace('%20', '+', get_query_var('s')))); exit(); } }
Forum: Plugins
In reply to: Plugin to show latest post on a remote page?Cool. If it works, post your solution here if you can. ??
Forum: Fixing WordPress
In reply to: HOWTO: Disable blogrollI would also like to hide the ‘Blogroll’ category in WordPress 2.2.1 on the admin side, without hacking the core.
The Blogroll won’t be used on my install and will only confuse people so I’d love to hide it! Ta.