ViewedShortcode & Offset?

  • Author
    Posts
  • Ernst Michalek
    Participant

    Hi,
    for an online magazine of a customer I would need the following function: posts are often split by <!–nextpage–>-Tags. They want to insert a shortcode in the first page with e.g. one related post, and in the following pages shortcodes with e.g. the next 3 related posts, with a different layout. Is it possible with your plugin to trigger different layouts and display a subset of related posts (e.g. via a count and an “offset”-switch) by shortcode?

    #5382
    iLen
    Keymaster

    Hello, I understand:
    -First page (1 design)
    -Second, third, fourth page (another design).

    At the moment this is not possible. But I recommend that if you know CSS you can do it manually.
    It occurs to me in this way:

    Within your file functions.php put this code.

    
    <?php
    add_action( 'wp_head', function(){
      global $wp_query;
      $page = $wp_query->query_vars['page'];
      if( empty($page) || $page == 0 ): ?>
        <style>.yuzo_related_post .relatedthumb{background:red!important;}</style>
      <?php else: ?>
        <style>.yuzo_related_post .relatedthumb{background:blue!important;}</style>
      <?php 
      endif; 
    } );
    ?>

    With this you will get on the first page have a design the “related post” and with the second page onwards have another design customized by you. 😎

    #5386
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.