• Resolved digestsua

    (@digestsua)


    Hi again,
    Plugin works like a charm!
    I have one more question;
    I modified a listing with the functions.php and set the date/time first.
    The problem is:
    The home page contains rows with time only
    Others have a date too before time.
    Custom css in Customizer modifies behavior on all pages and I have wrong design.
    wrapper_class applies to the whole block not to the row.
    How to modify css to set a different behavior for pages?
    Thank a lot for a fast reply.

    Example;
    Home page:

    22:17 The first article with lonooooooooooooong heading 
          continues on next line

    Second page:

    14.03.2019 22.17 The second article with loooooooooooong 
          heading on the next line

    I want to modify “text-indent” property for the second page. Modification of .list-item class changes mapping for all pages.

    • This topic was modified 5 years, 8 months ago by digestsua.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Can you share the code you added to functions.php to implement that?

    You can use the display_posts_shortcode_post_class filter to modify the classes added to the individual listing-item (examples).

    Thread Starter digestsua

    (@digestsua)

    Sure ??

    function be_dps_move_image_after_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class, $author,                 $category_display_text ) {
      $output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' .$date .'&nbsp;&nbsp;&nbsp;' . $title . $image . $author .                     $category_display_text . $excerpt . $content . '</' .     $inner_wrapper . '>';
      return $output;
    }
    add_filter( 'display_posts_shortcode_output', 'be_dps_move_image_after_title', 10, 11 );
    
    function myshortcode_title( ){
       return get_the_title();
    }
    add_shortcode( 'page_title', 'myshortcode_title' );
    
    function shortcode_post_published_date(){
     return get_the_date('d.m.Y H:i');
    }
    add_shortcode( 'post_published', 'shortcode_post_published_date' );
    Thread Starter digestsua

    (@digestsua)

    Examples of display_posts_shortcode_post_class are absent ??

    Plugin Author Bill Erickson

    (@billerickson)

    Here’s an example of customizing the post class on individual listing items: https://displayposts.com/2019/01/03/add-category-classes/

    I’m still not exactly clear on the issue you’re having. The code you provided simply moves the image after the title. It doesn’t affect the dates on the post.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS style for various pages’ is closed to new replies.