Coder Social home page Coder Social logo

wp-base-theme's People

Contributors

andradea3 avatar androso avatar jerivas avatar

Watchers

 avatar

Forkers

andradea3

wp-base-theme's Issues

Get rid of sidebar.php

Instead of get_sidebar() we can use partial() directly to get the sidebar we want: partial('template-parts/sidebar-blog')

Simplify masthead

Currently it assumes a lot of things and has a lot of conditionals

Add get_current_branch() util function

// utils.php
<?php
// Get the current branch (the branch that holds the currently active item)
// from a menu location. Useful to build sidebar page navigation links
function get_current_branch($items) {
  // If we receive a string assume it's a menu location, convert to a menu tree
  $items = is_string($items) ? menu_tree($items) : $items;

  foreach($items as $item) {
    if ($item->is_current) return $items;
    if (!$item->is_ancestor) continue;
    return get_current_branch($item->children);
  }
}
<!-- Example usage -->
<?php foreach(get_current_branch('Main Menu') as $item): ?>
  <a
    href="<?= $item->url ?>"
    <?php if ($item->is_current): ?>aria-current="page"<?php endif ?>
  >
    <?= $item->title ?>
  </a>
<?php endforeach ?>

Add responsive display helpers

// helpers.scss

@each $size in map-keys($mq-breakpoints) {
  @include mq($from: $size) {
    @each $value in (none, block, inline, flex) {
      ._display-#{$value}-#{$size} {
        display: $value !important;
      }
    }
  }
}

Theme testing

Funcion svg: test string vacia
funcion social_share_urls: Test url pagina actual, test caracter no valido

Update index.php

The current template simply outputs all the content from all posts. This is more like a blog post list:

<?php get_header(); ?>

<?php get_template_part('template-parts/site-masthead') ?>

<div class="section-wrapper">
  <div class="container">

    <main id="main" role="main">
      <?php if (have_posts()): ?>
        <?php while (have_posts()) : the_post(); ?>
          <article>
            <h2>
              <a href="<?php the_permalink() ?>">
                <?php the_title() ?>
              </a>
            </h2>
            <?php the_excerpt() ?>
          </article>
        <?php endwhile ?>
      <?php endif ?>
    </main>

    <?php partial('template-parts/sidebar-blog') ?>

  </div>
</div>

<?php the_posts_pagination(); ?>

<?php get_footer(); ?>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.