Skip to content

Instantly share code, notes, and snippets.

h1 {
font-family: 'Pacifico', cursive;
}
[lang="ar"] h1 {
font-family: 'Lemonada', cursive;
}
.text-end {
text-align: right; /* Fallback */
text-align: end;
}
[dir="rtl"] .text-end {
text-align: left; /* Fallback */
text-align: end;
}
<?php
class HMT_Language_Switcher_Widget extends WP_Widget
{
public function __construct()
{
parent::__construct(
'HMT_Language_Switcher_Widget',
__("Handmade's Tale Language Switcher", 'handmadestale'),
array(
<?php if (!isset($languages)) {
throw new Exception(__('Expected $languages array for printing'));
} ?>
<ul class="pure-menu-list pure-menu-horizontal text-end">
<?php foreach ($languages as $language) : ?>
<li class="pure-menu-item">
<a class="pure-menu-link" href="<?php echo $language['url']; ?>">
<?php echo $language['name']; ?>
</a>
<?php
require __DIR__ . '/classes/HMT_Language_Switcher_Widget.php';
// ...
/**
* Register our sidebars and widgetized areas.
*/
function hmt_widgets_init()
{
<div class="pure-u-1-3">
<!-- #language-switcher -->
<?php if (is_active_sidebar('trailing_main_nav')) : ?>
<div id="trailing_main_nav" class="widget-area">
<?php dynamic_sidebar('trailing_main_nav'); ?>
</div>
<?php endif; ?>
<!-- /#language-switcher -->
</div>
@ashour
ashour / header.php
Last active February 13, 2019 09:44
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<title>
<?php wp_title(''); ?>
<?php if (wp_title('', false)) {
echo ' | ';
} ?>
<?php
namespace App\Providers;
use App\Locale;
use Illuminate\Support\ServiceProvider;
class LocaleServiceProvider extends ServiceProvider
{
/**
import Firebase
class Product
{
typealias OnProductsFetched = (_ products: [Product]) -> Void
typealias Listener = ListenerRegistration
var name: String