4 changed files with 24 additions and 168 deletions
@ -1,105 +0,0 @@
|
||||
<?php |
||||
|
||||
namespace Aldine; |
||||
|
||||
use Sober\Controller\Controller; |
||||
|
||||
class App extends Controller |
||||
{ |
||||
public function siteLogo() |
||||
{ |
||||
$custom_logo_id = get_theme_mod('custom_logo'); |
||||
if (has_custom_logo()) { |
||||
return wp_get_attachment_image($custom_logo_id, 'original'); |
||||
} else { |
||||
return file_get_contents(get_theme_file_path() . '/dist/' . asset_dir('images/logo.svg')); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public static function networkFooter($index) |
||||
{ |
||||
if ($index === 2) { |
||||
if (get_option('pb_network_facebook') |
||||
|| get_option('pb_network_twitter') |
||||
|| is_active_sidebar("network-footer-block-$index") |
||||
) { |
||||
return $index; |
||||
} else { |
||||
return 'empty'; |
||||
} |
||||
} |
||||
return (is_active_sidebar("network-footer-block-$index")) ? |
||||
$index : |
||||
'empty'; |
||||
} |
||||
|
||||
public static function title() |
||||
{ |
||||
if (is_home()) { |
||||
if ($home = get_option('page_for_posts', true)) { |
||||
return get_the_title($home); |
||||
} |
||||
return __('Latest Posts', 'aldine'); |
||||
} |
||||
if (is_archive()) { |
||||
return get_the_archive_title(); |
||||
} |
||||
if (is_search()) { |
||||
return sprintf(__('Search Results for %s', 'aldine'), get_search_query()); |
||||
} |
||||
if (is_404()) { |
||||
return __('Not Found', 'aldine'); |
||||
} |
||||
return get_the_title(); |
||||
} |
||||
|
||||
|
||||
|
||||
public function currentPage() |
||||
{ |
||||
if (is_front_page()) { |
||||
return (get_query_var('page')) ? get_query_var('page') : 1; |
||||
} else { |
||||
return (get_query_var('paged')) ? get_query_var('paged') : 1; |
||||
} |
||||
} |
||||
|
||||
public function currentSubject() |
||||
{ |
||||
return (get_query_var('subject')) ? get_query_var('subject') : ''; |
||||
} |
||||
|
||||
public function currentLicense() |
||||
{ |
||||
return (get_query_var('license')) ? get_query_var('license') : ''; |
||||
} |
||||
|
||||
public function currentOrderBy() |
||||
{ |
||||
return (get_query_var('orderby')) ? get_query_var('orderby') : 'title'; |
||||
} |
||||
|
||||
public function previousPage() |
||||
{ |
||||
if (is_front_page()) { |
||||
$page = (get_query_var('page')) ? get_query_var('page') : 1; |
||||
} else { |
||||
$page = (get_query_var('paged')) ? get_query_var('paged') : 1; |
||||
} |
||||
|
||||
return ($page > 1) ? $page - 1 : 0; |
||||
} |
||||
|
||||
public function nextPage() |
||||
{ |
||||
if (is_front_page()) { |
||||
$page = (get_query_var('page')) ? get_query_var('page') : 1; |
||||
} else { |
||||
$page = (get_query_var('paged')) ? get_query_var('paged') : 1; |
||||
} |
||||
|
||||
return $page + 1; |
||||
} |
||||
} |
||||
@ -1,31 +0,0 @@
|
||||
<section class="banner" style="background-image: url(@if(is_front_page()) |
||||
@php(header_image()) |
||||
@else |
||||
@asset('images/catalog-header.jpg') |
||||
@endif);"> |
||||
<div class="container"> |
||||
<a class="toggle" href="#navigation">{{ __('Toggle menu', 'aldine') }}<span class="toggle__icon"></span></a> |
||||
<a class="banner__brand" href="{{ home_url('/') }}"><span class="clip">{{ get_bloginfo('name', 'display') }}</span>{!! $site_logo !!}</a> |
||||
<nav class="banner__navigation" id="navigation"> |
||||
@if(function_exists('pb_meets_minimum_requirements') && pb_meets_minimum_requirements()) |
||||
<a class="banner__navigation--catalog" href="{{ home_url('/catalog') }}">Catalog</a> |
||||
@endif |
||||
@if(get_option('pb_network_contact_form')) |
||||
<a class="banner__navigation--contact" href="#contact">Contact</a> |
||||
@endif |
||||
@if(!is_user_logged_in()) |
||||
<a class="banner__navigation--signin" href="{{ wp_login_url() }}">{{ __('Sign in', 'aldine') }}</a> |
||||
<span class="banner__navigation--sep">/</span> |
||||
<a class="banner__navigation--signup" href="{{ network_home_url('/wp-signup.php') }}">{{ __('Sign up', 'aldine') }}</a> |
||||
@else |
||||
<a class="banner__navigation--admin" href="{{ admin_url() }}">{{ __('Admin', 'aldine') }}</a> |
||||
<span class="banner__navigation--sep">/</span> |
||||
<a class="banner__navigation--signout" href="{{ wp_logout_url() }}">{{ __('Sign out', 'aldine') }}</a> |
||||
@endif |
||||
</nav> |
||||
<header class="banner__branding"> |
||||
<h1><a href="{{ home_url('/') }}">{{ get_bloginfo('name', 'display') }}</a></h1> |
||||
<p>{{ get_bloginfo('description', 'display') }}</p> |
||||
</header> |
||||
</div> |
||||
</section> |
||||
Loading…
Reference in new issue