How to Show the ‘View More’ button on all sessions?

  1. Home
  2. Docs
  3. Fudge
  4. Frequently Asked Question...
  5. How to Show the ‘View More’ button on all sessions?

How to Show the ‘View More’ button on all sessions?

To show all sessions without ‘View More’ button, please do the following:

 

1) Please do remember to back-up the files prior to any change.

 

2) Open wp-content/themes/fudge/functions.php

 

3) Around line number 1228, you can find the following code:

$session_loop_args = array(

‘post_type’ => ‘session’,

‘posts_per_page’ => $schedule_limit,

‘paged’ => $page,

‘meta_query’ => array(

array(

‘key’ => ‘date’,

‘value’ => $timestamp,

),

array(

‘key’ => ‘time’,

‘compare’ => ‘EXISTS’,

)

),

‘tax_query’ => array(),

‘meta_key’ => ‘date’,

‘orderby’ => ‘meta_value’,

‘order’ => ‘ASC’

);

 

4) Please replace the above code with

$session_loop_args = array(

‘post_type’ => ‘session’,

‘posts_per_page’ => -1,

‘paged’ => $page,

‘meta_query’ => array(

array(

‘key’ => ‘date’,

‘value’ => $timestamp,

),

array(

‘key’ => ‘time’,

‘compare’ => ‘EXISTS’,

)

),

‘tax_query’ => array(),

‘meta_key’ => ‘date’,

‘orderby’ => ‘meta_value’,

‘order’ => ‘ASC’

);

 

5) Around line number 1290, you can find

array_push($ret[‘sessions’], array(

‘id’ => get_the_ID(),

‘post_title’ => get_the_title(),

‘time’ => $time,

‘end_time’ => get_post_meta(get_the_ID(), ‘end_time’, true),

‘location’ => $location ? $location->name : ”,

‘background_color’ => $track ? fudge_get_term_meta(‘session-track-metas’, $track, ‘session_track_color’) : ”,

‘speakers’ => $speakers

));

 

6) Replace the above code with

array_push($ret[‘sessions’], array(

‘id’ => get_the_ID(),

‘post_title’ => get_the_title(),

‘time’ => $time,

‘end_time’ => get_post_meta(get_the_ID(), ‘end_time’, true),

‘location’ => $location ? $location->name : ”,

‘background_color’ => $track ? fudge_get_term_meta(‘session-track-metas’, $track, ‘session_track_color’) : ”,

‘speakers’ => $speakers,

‘post_content’=>get_the_excerpt()

));

 

7) Open wp-content/themes/fudge/js/script.js

 

8) Around line number 308, you can find

var html = ‘<div class=”session ‘ + concurrent + ‘”>

<div class=”location”>’ + session.location + ‘</div>

<div class=”time ‘ + concurrent + ‘”>’ + time + ‘</div>

<div class=”info”>

<a class=”btn-session main-bkg-color” title=”‘ + session.post_title + ‘” href=”#” data-id=”‘ + session.id + ‘” style=”background-color: ‘ + session.background_color + ‘!important;”>’ + session.post_title + ‘</a>

<ul>

‘ + speakers + ‘

</ul>

</div>

</div>’;

 

9) Replace the above with

var html = ‘<div class=”session ‘ + concurrent + ‘”>

<div class=”location”>’ + session.location + ‘</div>

<div class=”time ‘ + concurrent + ‘”>’ + time + ‘</div>

<div class=”info”>

<a class=”btn-session main-bkg-color” title=”‘ + session.post_title + ‘” href=”#” data-id=”‘ + session.id + ‘” style=”background-color: ‘ + session.background_color + ‘!important;”>’ + session.post_title + ‘</a>

<div>’ + session.post_content + ‘</div>

<ul>

‘ + speakers + ‘

</ul>

</div>

</div>’;

 

10) The above change will display excerpt(more tag in admin side) below the session title.

 

11) Around line number 325, you can find

if(data.page > 1)

$(‘#schedule .btn-less’).show();

else

$(‘#schedule .btn-less’).hide();

if(data.more == 1)

$(‘#schedule .btn-more’).show();

else

$(‘#schedule .btn-more’).hide();

 

12) Replace the above code with:

$(‘#schedule .btn-less’).hide();

$(‘#schedule .btn-more’).hide();

 

13) Save both files.

 

Was this article helpful to you? Yes 1 No