unplugstudio / wp-base-theme Goto Github PK
View Code? Open in Web Editor NEWBase WordPress theme
Base WordPress theme
Need to enforce on unary, binary, and ternary operators
Instead of get_sidebar()
we can use partial() directly to get the sidebar we want: partial('template-parts/sidebar-blog')
Currently it assumes a lot of things and has a lot of conditionals
// 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 ?>
Settle on a code style convention and enforce it
Looks like the styles are already there in skip-to-main.scss
but the markup is missing from header.php
Add JS and PHP helpers for AJAX queries
Use get_stylesheet_directory
Provide basic styles for keyboard accessibility (using a polyfill if necessary)
So our custom functions don't pollute the global namespace
Due to rtrim, should use str_replace instead
Including theme colors and buttons
To share any page to several social media sites
// 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;
}
}
}
}
Use return
instead to let caller decide to capture or echo
Funcion svg: test string vacia
funcion social_share_urls: Test url pagina actual, test caracter no valido
Instead of adding it manually in
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(); ?>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.