Forum Replies Created

Viewing 15 replies - 31 through 45 (of 364 total)
  • 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>'; ?>

    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! ??

    I’m looking for the same thing, I’d like to display just a single user’s own status on a profile page….?

    Thread Starter 3stripe

    (@3stripe)

    Oh thanks for the link, looks like it’s for WordPress MU though, still might be useful though I guess ??

    Thread Starter 3stripe

    (@3stripe)

    lol, 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!

    ^ 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!

    Found an easy fix ??

    if (!is_page() && (is_child('Blog') || in_category('1')))

    It’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 . ' ';
    }

    Hello 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');
    }
    
    ?>

    Anyone 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 ??

    I 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!

    Thread Starter 3stripe

    (@3stripe)

    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)

    Thread Starter 3stripe

    (@3stripe)

    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();
        }
    }

    Cool. If it works, post your solution here if you can. ??

    I 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.

Viewing 15 replies - 31 through 45 (of 364 total)