Skip to content

Commit

Permalink
Redirects item breadcrumb to collection cover page, if set. #15.
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuswetah committed Apr 2, 2024
1 parent bb475fd commit c4a9082
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tainacan-blocksy/inc/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,18 @@ function tainacan_blocksy_custom_breadcrumbs( $array ) {
$args = $_GET;

for ($i = 0; $i < count($array); $i++) {

if ( isset( $array[$i]['url'] ) && $array[$i]['url'] == get_post_type_archive_link($post_type) ) {
$collection = tainacan_get_collection();

if ( $collection->is_cover_page_enabled() ) {
$cover_page_id = $collection->get_cover_page_id();
$cover_page_url = get_permalink($cover_page_id);

$array[$i]['url'] = $cover_page_url;
}
continue;
}

// Check if the current thumbnail links to the collection, then enriches its URL
if (
Expand Down

0 comments on commit c4a9082

Please sign in to comment.