[Support request] Custom posts list styling

Home Forums Support [Support request] Custom posts list styling

Home Forums Support Custom posts list styling

  • This topic has 5 replies, 2 voices, and was last updated 6 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #558777
    Krzysztof

    Hello, I am trying to achieve look of recent posts similar to http://www.mdk.gdynia.pl/ website.
    Can anyone point me to the direction as with how can I achieve those dates above posts?

    #559243
    Tom
    Lead Developer
    Lead Developer

    It would likely involve some custom HTML/PHP/CSS. What kind of blog layout do you have right now?

    #559295
    Krzysztof

    Right now I am using basic masonry layout from GP. Will add some styling, but can’t figure a way to add date similar to that Joomla site.

    #559701
    Tom
    Lead Developer
    Lead Developer

    Can you link me to your site? I might be able to help with some code.

    Let me know ๐Ÿ™‚

    #561233
    Krzysztof

    mdkpruszkow.pl
    This is just a sketch, because now they are filling in posts, but it is basicly using Masonry on base layout of categories.

    #561473
    Tom
    Lead Developer
    Lead Developer

    Ok, might take a couple goes, but we should be able to do this.

    First step, adding the HTML:

    add_action( 'generate_before_content', 'tu_add_custom_date' );
    function tu_add_custom_date() {
        if ( is_singular() ) {
            return;
        }
    
        printf( '<div class="custom-date"><span class="day">%1$s</span><span class="month">%2$s</span></div>',
            get_the_date( 'j' ),
            get_the_date( 'M' )
        );
    }

    Let me know when you get that added and we should be able to get the rest of the way with CSS ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.