SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress - order by custom field then title?

    Hi all

    I've got an increasingly complex setup using WP which uses custom fields to add bits of HTML around a post to highlight that post - which works fine. The posts are ordered by title.

    Is it possible, in a general Category page, to list posts with a certain custom field first and then list the remaining posts in that cat by title?

    I've got this (simplified version obviously!):

    PHP Code:
    <?php
         $premium 
    get_post_meta($post->ID'Premium'$single true);
     
    ?>

      <?php
           
    if($premium != '') {
           echo 
    'html stuff' ;
           }
       
    ?>
    I thought I'd be able to use the if() to show all posts with the custom query and then show all posts in that cat without it - but I'm having no luck!
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this look difficult for me . sorry i can't help thou i am a wordpress programer.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •