• Wich loops and php script do I have to write to have only the news by day and with the date in french please ?

    lundi 5 mars

    10h00 – title news 1
    11h00 – title news 2
    12h00 – title news 3

    mardi 6 mars

    10h00 – title news 1
    11h00 – title news 2
    12h00 – title news 3

    mercredi 7 mars

    10h00 – title news 1
    11h00 – title news 2
    12h00 – title news 3

    Thanks to help me with this !

Viewing 4 replies - 1 through 4 (of 4 total)
  • What about this plugin using the list format:
    https://www.ads-software.com/extend/plugins/smart-archives-reloaded/

    There’s a French version also.

    Thread Starter dd46

    (@dd46)

    Hi thanks for this link, but it seems to be for the archive article. If possible I would like to display the last news of the 3 or 4 days with a maximum number of 20 news.
    But thanks for your reply, I am going to look inside the code of this plug-in for understanding how to do my specific script ??
    Please is there someone who know how to build this particular script ?

    In a sense, every post belongs to an ‘archive’.

    Don’t be confused by what an archive is–it is just a generated display of your posts at that moment. You don’t do anything to create the archive, that’s an automatic thing WordPress does for you. Usually, archives are date, category, tag, or author, based.

    Access to archives is typically presented via links in a sidebar under an Archive (date based), Category, or Tag Cloud, headings. Widgets, or Template Tags such as wp_get_archives(), wp_list_categories(), wp_tag_cloud(), and wp_list_authors(), are the constructs used to present links to users to visit your various archives. The process of placing code in your Theme’s Templates is explained in Stepping Into Templates and Stepping Into Template Tags.

    Once a user clicks on a Category link in the sidebar, the display of those posts can be controlled by a Category Template. Other Templates, such as Author Templates, and Tag Templates, are available if you set them up. These Templates can be coded via Template Tags such as the_title(), the_content(), or the_excerpt(), to display just a post title, the full content of the post, or just an excerpt of the post.

    Also, it is important to understand the Template Hierarchy, as that is how WordPress determines what Template to use to render the posts for reading by your readers.

    Thread Starter dd46

    (@dd46)

    Hi thanks for your reply, I didn’t think this way and I read your links for a better understanding of wordpress.
    For my news display I think I can use query_posts like this :

    <?php
    function filter_where($where = '') {
        //posts in the last 3 days
        $where .= " AND post_date > '" . date('Y-m-d', strtotime('-3 days')) . "'";
        return $where;
      }
    add_filter('posts_where', 'filter_where');
    query_posts($query_string);
    ?>

    But how to start the display of the news today and count it two days in the past ? How to display the date of each day and the time before each news title ?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php loops for special displaying news in wordpress’ is closed to new replies.