Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1281622

    Hi,

    I have an issue with the portfolio grid layout. Each entry is showing the date of the page that contains the grid layout. However, this should be the date of the portfolio entry, obviously.

    Portfolio grid layout

    This is the code:
    Portfolio grid layout

    Could anyone please tell me how I can get it to show the right dates?

    Regards,
    Roger

    • This topic was modified 3 years, 2 months ago by EZWebdesign.
    #1281626

    is there a link you can make here public. only that image leads me to a different way it was generated than over the portfolio grid alb element.

    Edit Ok – i didn’t see that there is : “special column layout – side by side” option. ( has this been around for a while?)

    Next Question – how do you set the date to this element? because on default i got no date there.
    Are these portfolio ALB generated – or set by classic editor. Do you have inserted here the post meta data?
    If so – did you take the publishing date or the last modified date etc. pp

    more input please

    • This reply was modified 3 years, 2 months ago by Guenni007.
    #1281629

    on my versions of Enfold : 4.7.6.4 and testing 4.8 beta – there are no options to show title – excerpt and read more !
    no option to show post meta here – that is the reason for my question – where did you set to show the date?

    Only Chance to see it is to put in the excerpt field the shortcodes of the postmeta

    #1281639

    Hi Guenni007,

    Thanks for your answer. I’m sorry I didn’t mention how I got the meta-data over there: it’s due to a small modification in functions.php:

    add_filter('avf_portfolio_extra', 'avf_portfolio_extra_mod', 10, 2);
    function avf_portfolio_extra_mod($output, $entry) {
    	$output = '<div class="portfolio-new-meta">';
    	$output .= '<div class="portfolio-read-more-link"><a href="'.get_permalink($entry->ID).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"></span></a></div>';
    	$output .= "<time class='date-container minor-meta updated' $markup>".get_the_time(get_option('date_format'))."</time>";
     	$output .= '</div>';
    	return $output;
    }

    So the only question would be: how can I get the publishing date, something like: $entry->publishing_date ??

    Regards,
    Roger

    #1281652

    First – does it realy work with $markup ? at the classes

    what about this :

    add_filter('avf_portfolio_extra', 'avf_portfolio_extra_mod', 10, 2);
    function avf_portfolio_extra_mod($output, $entry) {
    	$output = '<div class="portfolio-new-meta">';
    	$output .= '<div class="portfolio-read-more-link"><a href="'.get_permalink($entry->ID).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"></span></a></div>';
    	$output .= '<time class="date-container minor-meta updated">'.get_the_date("Y-m-d", $entry).'</time>';
     	$output .= '</div>';
    	return $output;
    }

    the point is to include the same relation to the entry ID as on permalink – you can do everything as format you like f.e.

    .get_the_date("d. M Y", $entry).
    

    on default the month names are localized via General Setting Language of the page

    by the way: thanks – nice use of that filter !

    #1281661

    Hi Guenni007,

    Thanks very much, it works! You can see the result here: https://watt-infra.nl/blog/

    About the $markup: I don’t know where this came from, but it works just fine without it, so I removed it, thanks!.

    Maybe one more thing: is it possible to get the full localized/translated (Dutch) monthname in the date? We want it like this: 12 februari 2021

    Regards,
    Roger

    #1281671

    if you like to have some binding words between the date shortcodes you had to insert a \ before the letters each – if they got a meaning on date format like a or t ( am/pm , time, etc.)

    f.e. this:

     .get_the_date("j\. F Y \a\\t G:i", $entry).
    

    see: https://wordpress.org/support/article/formatting-date-and-time/

    don’t know why a double \\ must before the t – but that works

    PS: it seems to slow down the site on loading if you got a lot of entries on that page.
    Maybe a Mod knows a better way to insert the entry date to that place

    • This reply was modified 3 years, 2 months ago by Guenni007.
    #1281694

    Sorry – take the time only form $entry – i changed the snippet above so try for your needs:

    
    function avf_portfolio_extra_mod($output, $entry) {
    	$output = '<div class="portfolio-new-meta">';
    	$output .= '<div class="portfolio-read-more-link"><a href="'.get_permalink($entry->ID).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"></span></a></div>';
    	$output .= '<time class="date-container minor-meta updated">' .get_the_date("j. F Y", $entry).'</time>';
     	$output .= '</div>';
    	return $output;
    }
    add_filter('avf_portfolio_extra', 'avf_portfolio_extra_mod', 10, 2);
    #1281727

    Thanks again Guenni007, it works again and looks really nice. Happy with it :-).

    I also noticed some poor performance, but there will not be a lot of entries on this page, max. 3.

    Regards,
    Roger

    #1281731

    by the way – i shift it this way:

    function shift_extra_portfolio_meta(){ 
    ?>
    <script type="text/javascript">
    (function($) {
            $('.portfolio-new-meta').each(function() {
                $(this).next('.portfolio-entry').append($(this));
            }); 
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'shift_extra_portfolio_meta');

    do not forget to get rid of this $markup in your code

    #1281896

    maybe you give a different color to the time format:

    .portfolio-new-meta .date-container {
        color: #999 !important;
    }

    ________________

    Sad it is closed –

    PPS: the responsive case is not nice – so try:

    @media only screen and (max-width: 767px) {
      .blog-samenvatting.grid-sort-container {
        display: flex !important;
        flex-flow: row wrap;
        justify-content: space-between;
      }
    
      .blog-samenvatting.grid-sort-container .grid-entry {
        flex: 1 1 100% !important;
        width: unset !important;
        margin: 0 0 50px !important;
        padding: 0;
      }
      
      .blog-samenvatting.grid-sort-container .grid-entry .inner-entry > div  {
        width: 100% !important;
      }
      
      /****  these lines only if you like to have the image on top ******/
      .blog-samenvatting.grid-sort-container .grid-entry .inner-entry   {
        display: flex !important;
        flex-flow: wrap-reverse row;
        justify-content: stretch
      }
      
      #top .isotope-item.special_av_fullwidth .av_table_col .avia-arrow {
        top: 0%;
      }
     /****** remove it between these two comments if you are stisfied with image under the content *******/
    }

    and switch at every px-value you like – maybe 989 is better

    • This reply was modified 3 years, 1 month ago by Guenni007.
    #1282047

    I totally agree with you, so I changed it. Thanks for the advice!

    You may close this ticket if you like.

    Regards,
    Roger

    PS: When will the new 4.8 be available? Please keep in mind that I like to translate the beta so that 4.8 will have 100% translated Dutch strings when it’s available.

    #1282232

    Hi,

    The latest version should be available anytime soon, but we do not know the exact date yet. Please feel free to open another thread should you need anything else. Glad that @Guenni007 helped you with this one.

    Have a nice day.

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Issue with portfolio grid layout’ is closed to new replies.