Skip to content

Commit

Permalink
Merge pull request #5 from Shoptet/menuCaret
Browse files Browse the repository at this point in the history
Redesign menu to accomodate clickable link with submenu by removing
  • Loading branch information
Veronika Dvořáková authored Jul 18, 2018
2 parents 06501be + dd1615b commit a4e6f57
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 24 deletions.
24 changes: 19 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Shp_Walker_Nav_Menu extends Walker_Nav_Menu {

function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"shp_navigation-submenu dropdown-menu\" aria-labelledby=\"categoriesDropdown\">\n";
$output .= "\n$indent<ul class=\"shp_navigation-submenu dropdown-menu dropdown-menu-right\" aria-labelledby=\"categoriesDropdown\">\n";
}

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
Expand All @@ -81,6 +81,7 @@ function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$class_names = $value = '';

$classes[] = ($item->current || $item->current_item_ancestor) ? 'active' : '';
$classes[] = ($args->has_children) ? 'has-dropdown' : '';
$classes[] = 'shp_menu-item';


Expand All @@ -93,12 +94,13 @@ function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$attributes .= ($args->has_children) ? ' class="shp_menu-item-link dropdown-toggle" data-target="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"' : ' class="shp_menu-item-link"';
$attributes .= ' class="shp_menu-item-link"';

$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= ($args->has_children) ? ' <span class="caret"></span></a>' : '</a>';
$item_output .= '</a>';
$item_output .= ($args->has_children) ? '<span class="caret dropdown-toggle" data-target="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>' : '';
$item_output .= $args->after;

$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
Expand Down Expand Up @@ -231,7 +233,7 @@ function get_shoptet_footer() {
/**
* Register widgets
*/
function arphabet_widgets_init() {
function shp_widgets_init() {
register_sidebar( array(
'name' => 'Contact form',
'id' => 'contact_form',
Expand All @@ -240,8 +242,20 @@ function arphabet_widgets_init() {
'before_title' => '<h2>',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Page Bottom Widget',
'id' => 'page_bottom_widget',
'before_widget' => '<div>',
'after_widget' => '</div>',
) );
register_sidebar( array(
'name' => 'Post Bottom Widget',
'id' => 'post_bottom_widget',
'before_widget' => '<div>',
'after_widget' => '</div>',
) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
add_action( 'widgets_init', 'shp_widgets_init' );

/* Custom Pagination for posts */
function shp_wp_custom_pagination() {
Expand Down
4 changes: 2 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<div id="navigation">
<div class="container">
<div id="shp_navigation_wrapper">
<?php wp_nav_menu( array('menu' => 'Main', 'menu_class' => '', 'menu_id' => 'shp_navigation', 'container'=> false, 'walker'=> new Shp_Walker_Nav_Menu)); ?>
<div id="shp_navigation_wrapper" class="responsive-nav">
<?php wp_nav_menu( array('menu' => 'Main', 'menu_class' => 'visible-links', 'menu_id' => 'shp_navigation', 'container'=> false, 'walker'=> new Shp_Walker_Nav_Menu)); ?>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion scaffolding
1 change: 1 addition & 0 deletions template-parts/page/content-content.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<section class="section section-primary">
<div class="section-inner container">
<?php the_content(); ?>
<?php get_template_part( 'template-parts/page/content', 'widget' ); ?>
</div>
</section>
34 changes: 34 additions & 0 deletions template-parts/page/content-excerpt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<article>
<?php if ( get_the_post_thumbnail() !== '' && ! is_single() ) : ?>
<div class="row">
<div class="entry-thumbnail col-sm-12 col-md-4 col-lg-4">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
<div class="col-sm-12 col-md-8 col-lg-8">
<?php endif; ?>

<?php if ( is_front_page() && ! is_home() ) {

// The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
} else {
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
} ?>

<?php get_template_part( 'template-parts/post/content', 'meta' ); ?>

<div class="entry-summary">
<?php the_excerpt(); ?>
</div>

<div class="entry-more">
<a href="<?php the_permalink(); ?>" class="btn btn-secondary">Přečíst celé</a>
</div>

<?php if ( get_the_post_thumbnail() !== '' && ! is_single() ) : ?>
</div> <!-- !.col -->
</div> <!-- !.row -->
<?php endif; ?>
</article>
9 changes: 9 additions & 0 deletions template-parts/page/content-widget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php if ( is_active_sidebar( 'page_bottom_widget' )) { ?>

<div class="row">
<div class="col-12">
<?php dynamic_sidebar( 'page_bottom_widget' ); ?>
</div>
</div>

<?php } ?>
2 changes: 2 additions & 0 deletions template-parts/post/content-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

the_content();

get_template_part( 'template-parts/post/content', 'widget' );

get_template_part( 'template-parts/post/content', 'tags' );

get_template_part( 'template-parts/post/content', 'navigation' );
Expand Down
2 changes: 1 addition & 1 deletion template-parts/post/content-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
} ?>

<?php get_template_part( 'template-parts/post/content', 'meta' ); ?>
<?php get_template_part( 'template-parts/post/content', 'meta' ); ?>

<div class="entry-summary">
<?php the_excerpt(); ?>
Expand Down
9 changes: 9 additions & 0 deletions template-parts/post/content-widget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php if ( is_active_sidebar( 'post_bottom_widget' )) { ?>

<div class="row">
<div class="col-12">
<?php dynamic_sidebar( 'post_bottom_widget' ); ?>
</div>
</div>

<?php } ?>
9 changes: 9 additions & 0 deletions template-parts/utils/content-breadcrumb.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('
<div class="breadcrumb">','</div>
');
} else {
shp_breadcrumb();
}
?>
32 changes: 17 additions & 15 deletions tmp/shoptet-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#shp_footer a, #shp_footer ul li a { color: #14b1ef; text-decoration: none; display: inline; }
#shp_footer a:hover, #shp_footer ul li a:hover { color: #0F9AD2; }
#shp_footer p { margin: 5px 0; line-height: 20px; color: #1f1f1f; font-family: 'Source Sans Pro', sans-serif; font-size: 14px; font-weight: 400; text-align: left; color: #1f1f1f; }
#shp_footer ul { list-style-type: none; list-style-image: url('https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/li.png'); padding: 5px 0 0 15px; margin: 0; }
#shp_footer ul { list-style-type: none; list-style-image: url('https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/li.png'); padding: 5px 0 0 15px; margin: 0; }
#shp_footer ul li { padding: 0 0 5px; margin: 0; line-height: 18px; background: none; }
#shp_footer .mr-15 { margin-right: 15px; }
/* grid design */
Expand Down Expand Up @@ -115,26 +115,28 @@ <h2>Založte si nezávazně vlastní testovací e-shop na Shoptetu</h2>
<div class="shp_row">
<div class="shp_col" id="shp_footer-description">
<a href="https://www.shoptet.cz/" target="_blank"><img src="https://cdn.myshoptet.com/tpl/13953298/shoptet_responsive/master/templates/shoptet_responsive/img/logo.svg" width="200"></a>
<p>Shoptet se na českém a slovenském trhu specializuje na <a href="/provozovani-e-shopu/">pronájem e-shopových řešení</a>, která jsou oblíbená zejména pro jednoduché a intuitivní ovládání. V současné chvíli Shoptet pomáhá podnikat již 13721 aktivním e-shopům, což je třetina všech internetových obchodů působících na českém a slovenském trhu. Také nabízí <a href="/sprava-kamenne-prodejny/">pokladní systém</a>, který umožňuje správu e-shopu a kamenného obchodu v rámci jednoho on-line systému. Samozřejmostí je vše potřebné pro EET a GDPR.</p>
<p>Shoptet blog vám přináší články ze světa e-commerce. Najdete tu novinky z e-shopové scény, rozhovory s nejlepšími českými marketingovými odborníky, tipy pro plynulé fungování vašeho e-shopu i příběhy úspěšných e-shopařů, které vás můžou inspirovat a příjemně nakopnout.</p>

</div>
<div class="shp_col" id="shp_footer-information-links">
<h3>Informace</h3>
<ul>
<li><a href="/co-umime/">Co umíme</a></li>
<li><a href="/cenik/">Ceník</a></li>
<li><a href="/sablony/">Šablony</a></li>
<li><a href="/reference/">Reference</a></li>
<li><a href="https://help.shoptet.cz">Nápověda</a></li>
<li><a href="/kontakt/">Kontakty</a></li>
<li><a href="/shoptet">Shoptet novinky</a></li>
<li><a href="/rozhovory">Rozhovory</a></li>
<li><a href="/pro-zacatecniky">Začínáme</a></li>
<li><a href="/marketing">Marketing</a></li>
<li><a href="/socialni-media">Sociální média</a></li>
<li><a href="/webdesign">Webdesign</a></li>
<li><a href="/optimalizace-seo">Optimalizace (SEO)</a></li>
<li><a href="/vyhledavace">Vyhledávače</a></li>
<li><a href="https://www.shoptet.cz/">Shoptet.cz </a></li>
</ul>
</div>
<div class="shp_col" id="shp_footer-recommended-links">
<h3>Doporučujeme</h3>
<ul>
<li><a href="https://partneri.shoptet.cz/" target="_blank">Shoptet Partneři</a></li>
<li><a href="https://help.shoptet.cz/" target="_blank">Shoptet Nápověda</a></li>
<li><a href="https://blog.shoptet.cz/" target="_blank">Shoptet Blog</a></li>
<li><a href="https://www.facebook.com/groups/shoptetporadna/" target="_blank">Shoptet Poradna</a></li>
<li><a href="https://www.mujprvnieshop.cz/" target="_blank">Můj první e-shop</a></li>
<li><a href="https://ceska-ecommerce.cz/" target="_blank">Česká e-commerce</a></li>
Expand All @@ -160,11 +162,11 @@ <h3>Odběr novinek</h3>
</form>
<h3>Kde nás najdete</h3>
<div class="social-icons">
<a href="https://www.facebook.com/shoptet/" target="_blank"><img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-facebook.svg" alt=""></a>
<a href="https://twitter.com/shoptet" target="_blank"><img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-twitter.svg" alt=""></a>
<a href="https://www.instagram.com/shoptet.cz/" target="_blank"><img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-instagram.svg" alt=""></a>
<a href="https://www.youtube.com/channel/UCrmFOFsJ7Nd3viUS_Kf5jsg" target="_blank"><img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-youtube.svg" alt=""></a>
<a href="https://cz.linkedin.com/company/shoptet" target="_blank"><img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-linkedin.svg" alt=""></a>
<a href="https://www.facebook.com/shoptet/" target="_blank"><img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-facebook.svg" alt=""></a>
<a href="https://twitter.com/shoptet" target="_blank"><img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-twitter.svg" alt=""></a>
<a href="https://www.instagram.com/shoptet.cz/" target="_blank"><img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-instagram.svg" alt=""></a>
<a href="https://www.youtube.com/channel/UCrmFOFsJ7Nd3viUS_Kf5jsg" target="_blank"><img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-youtube.svg" alt=""></a>
<a href="https://cz.linkedin.com/company/shoptet" target="_blank"><img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-linkedin.svg" alt=""></a>
</div>
<p>
<span class="mr-15"><a href="https://www.shoptet.cz/obchodni-podminky/" target="_blank">Obchodní podmínky</a></span>
Expand All @@ -178,7 +180,7 @@ <h3>Kde nás najdete</h3>
<div class="shp_container">
<div class="shp_row">
<div class="shp_col hide-sm">&nbsp;</div>
<div class="shp_col text-center">s&nbsp;<img src="https://cdn.myshoptet.com/tpl/5b60a2f6/shoptet_responsive/master/templates/shoptet_responsive/img/ico-hearth.png" width="17" height="14" alt="láskou">&nbsp;Shoptet</div>
<div class="shp_col text-center">s&nbsp;<img src="https://cdn.myshoptet.com/tpl/4be058ab/shoptet_responsive/master/templates/shoptet_responsive/img/ico-hearth.png" width="17" height="14" alt="láskou">&nbsp;Shoptet</div>
<div class="shp_col text-right">2008–2018 &copy; Shoptet s.r.o. Všechna práva vyhrazena</div>
</div>
</div>
Expand Down

0 comments on commit a4e6f57

Please sign in to comment.