Skip to content
Snippets Groups Projects
Commit 9b2c2464 authored by Anton Sarukhanov's avatar Anton Sarukhanov
Browse files

Add homepage widget area; Margin fixes; Cleanup stupid WP code spacing

parent a0b9ebe8
Branches master
No related tags found
No related merge requests found
Pipeline #5 skipped
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
*/ */
// Exit if accessed directly // Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) { if (!defined( 'ABSPATH')) {
exit; exit;
} }
function remove_parent_theme_crap() { function remove_parent_theme_crap() {
// Remove ads and junk // Remove ads and junk
remove_action( 'admin_menu', 'cyberchimps_add_upsell' ); remove_action('admin_menu', 'cyberchimps_add_upsell');
remove_action( 'tgmpa_register', 'responsive_install_plugins' ); remove_action('tgmpa_register', 'responsive_install_plugins');
remove_action( 'responsive_theme_options', 'responsive_upgrade_bar', 1 ); remove_action('responsive_theme_options', 'responsive_upgrade_bar', 1);
remove_action( 'responsive_theme_options', 'responsive_theme_support', 2 ); remove_action('responsive_theme_options', 'responsive_theme_support', 2);
} }
add_action('after_setup_theme', 'remove_parent_theme_crap'); add_action('after_setup_theme', 'remove_parent_theme_crap');
...@@ -24,16 +24,16 @@ add_action('after_setup_theme', 'remove_parent_theme_crap'); ...@@ -24,16 +24,16 @@ add_action('after_setup_theme', 'remove_parent_theme_crap');
* The one in 'responsive' prints author name, which would be stupid here. * The one in 'responsive' prints author name, which would be stupid here.
* *
*/ */
if ( !function_exists( 'responsive_post_meta_data' ) ) { if (!function_exists('responsive_post_meta_data')) {
function responsive_post_meta_data() { function responsive_post_meta_data() {
printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s">', 'responsive' ), printf(__('<span class="%1$s">Posted on </span>%2$s<span class="%3$s">', 'responsive'),
'meta-prep meta-prep-author posted', 'meta-prep meta-prep-author posted',
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="timestamp updated" datetime="%3$s">%4$s</time></a>', sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="timestamp updated" datetime="%3$s">%4$s</time></a>',
esc_url( get_permalink() ), esc_url(get_permalink()),
esc_attr( get_the_title() ), esc_attr(get_the_title()),
esc_html( get_the_date('c')), esc_html(get_the_date('c')),
esc_html( get_the_date() ) esc_html(get_the_date())
), ),
'byline' 'byline'
); );
...@@ -42,18 +42,29 @@ if ( !function_exists( 'responsive_post_meta_data' ) ) { ...@@ -42,18 +42,29 @@ if ( !function_exists( 'responsive_post_meta_data' ) ) {
} }
/** /**
* Display Posts Shortcode - Exclude Some Posts * Display Posts Shortcode - Exclude Some Posts
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/ * @link https://wordpress.org/plugins/display-posts-shortcode/
*
* @param array $args
* @param array $atts
* @return array $args
*/ */
function be_display_posts_shortcode_exclude_posts( $args, $atts ) { function anton_display_posts_shortcode_exclude_posts($args, $attrs) {
if( isset( $atts['hide_sticky'] ) ) { if(isset( $attrs['hide_sticky'])) {
$args['post__not_in'] = get_option('sticky_posts'); $args['post__not_in'] = get_option('sticky_posts');
} }
return $args; return $args;
} }
add_filter( 'display_posts_shortcode_args', 'be_display_posts_shortcode_exclude_posts', 10, 2 ); add_filter( 'display_posts_shortcode_args', 'anton_display_posts_shortcode_exclude_posts', 10, 2 );
/**
* Add widget area(s)
*/
function anton_widgets_init() {
register_sidebar(array(
'name' => 'Home After Content',
'id' => 'home_after_content',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
add_filter('widgets_init', 'anton_widgets_init');
...@@ -43,6 +43,12 @@ get_header(); ...@@ -43,6 +43,12 @@ get_header();
<?php responsive_entry_bottom(); ?> <?php responsive_entry_bottom(); ?>
<?php if (is_active_sidebar('home_after_content')): ?>
<div id="home-after-content" class="widget-area">
<?php dynamic_sidebar('home_after_content'); ?>
</div>
<?php endif; ?>
<h3>Projects</h3> <h3>Projects</h3>
<?php <?php
$args = array( $args = array(
......
...@@ -16,6 +16,14 @@ html { ...@@ -16,6 +16,14 @@ html {
-webkit-text-size-adjust: none; -webkit-text-size-adjust: none;
} }
p {
margin: 1em 0;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0.25em;
}
/* General stuff */ /* General stuff */
#content, #content,
#content-full, #content-full,
...@@ -39,6 +47,7 @@ p:empty { ...@@ -39,6 +47,7 @@ p:empty {
text-align: right; text-align: right;
width: 200px; width: 200px;
max-width: 40%; max-width: 40%;
margin-left: .5em;
} }
.me-sidebar img { .me-sidebar img {
width: 160px; width: 160px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment