Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1918

    I have added a new function into lots_of_small_helpers.php. It basically checks which category the post is in and if it is in a particular one it orders them by customer field (thank you to

    I would like to verify that within the Newscast theme it is ok to place it in that lots_of_small_helpers.php or should I place it in the functions.php.

    Many thanks


    You can copy and paste your code in every file you like – you can even create a new php file but don’t forget to include it. I prefer to paste custom functions and filters into functions.php but you can also use lots_of_small_helpers.php


    I would love to know what Helen put in her functions.php file to get the posts to reorder by a date in the custom fields panel.


    It seems that the link above doesn’t work anymore… :-(



    I actually did in a completely different way.

    1. I created a post emaplte for the category I was working on.

    2. I installed the plugin ‘Date Field’ This enables a custom field to be created for your post with a date/time format.

    3. Just before the loop I placed

    global $query_string;

    query_posts($query_string. ‘&orderby=meta_value&meta_key=date_value&order=ASC’ );

    Hope this helps someone.


    Thanks Helen for sharing your code here.


    Nice! Is she still putting this code into the functions.php file? What does she mean by “just before the loop”? Can you be specific where this code goes, thanks.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Adding a new function for 'post ordering' based on custom field’ is closed to new replies.