pressbooks aldine theme the theme used for the front page or default book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.0 KiB

7 years ago
<?php
namespace Aldine;
7 years ago
use Sober\Controller\Controller;
class App extends Controller
{
public function siteLogo()
{
7 years ago
$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/' . svg_path('images/logo.svg'));
}
}
7 years ago
public function siteName()
{
return get_bloginfo('name');
}
public function networkFacebook()
{
return get_option('pb_network_facebook');
}
public function networkTwitter()
{
return get_option('pb_network_twitter');
}
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 "network-footer-block-$index";
} else {
return 'empty';
}
}
return (is_active_sidebar("network-footer-block-$index")) ? "network-footer-block-$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 contactFormTitle()
{
$title = get_option('pb_network_contact_form_title');
if ($title) {
return $title;
}
return __('Contact Us', 'aldine');
}
7 years ago
}