diff --git a/functions.php b/functions.php index 4aacc16..ce155a5 100644 --- a/functions.php +++ b/functions.php @@ -4,7 +4,7 @@ if (! defined('WP_DEBUG')) { } /** Theme version */ -const BLOCKSY_TAINACAN_VERSION = '0.0.1'; +const BLOCKSY_TAINACAN_VERSION = '0.1.0'; /** * Enqueue scripts and styles. @@ -23,7 +23,7 @@ add_action( 'wp_enqueue_scripts', function () { // Now, some dynamic css that is generated using blocksy dynamic css logic add_action('blocksy:global-dynamic-css:enqueue', function ($args) { blocksy_theme_get_dynamic_styles(array_merge([ - 'path' => get_stylesheet_directory() . '/global.php', + 'path' => get_stylesheet_directory() . '/inc/global.php', 'chunk' => 'global', 'forced_call' => true ], $args)); @@ -36,8 +36,8 @@ add_action( 'wp_enqueue_scripts', function () { function blocksy_tainacan_get_adjacent_item_links() { $prefix = blocksy_manager()->screen->get_prefix(); - $has_thumb = get_theme_mod($prefix . '_has_post_nav_thumb', 'yes') === 'yes'; + // We use Tainacan own method for obtaining previous and next item objects if (function_exists('tainacan_get_adjacent_items') && isset($_GET['pos'])) { $adjacent_items = tainacan_get_adjacent_items(); @@ -64,6 +64,11 @@ function blocksy_tainacan_get_adjacent_item_links() { $next_title = get_the_title( get_next_post() ); } + // Then we obtain blocksy settings + $has_thumb = get_theme_mod($prefix . '_has_post_nav_thumb', 'yes') === 'yes'; + + $has_title = get_theme_mod($prefix . '_has_post_nav_title', 'yes') === 'yes'; + $previous = ''; $next = ''; @@ -100,9 +105,6 @@ function blocksy_tainacan_get_adjacent_item_links() { ] ); - } else { - $previous = $previous_link_url === false ? '' : ' ' . $previous_title . ''; - $next = $next_link_url === false ? '' :'' . $next_title . ' '; } // Creates the links @@ -111,7 +113,7 @@ function blocksy_tainacan_get_adjacent_item_links() { ($has_thumb ? $previous_post_image_output : '') . '