Browse Source

Clean up blocks on front page, a bit.

pull/43/head
Ned Zimmerman 7 years ago
parent
commit
3ad5a0513d
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 1
      assets/styles/components/_forms.scss
  2. 4
      dist/mix-manifest.json
  3. 2
      dist/styles/aldine.css
  4. 2
      dist/styles/editor.css
  5. 13
      inc/helpers/namespace.php
  6. 4
      partials/content-front-page.php
  7. 9
      partials/content-page.php

1
assets/styles/components/_forms.scss

@ -1,5 +1,6 @@
label { label {
margin-bottom: 1rem; margin-bottom: 1rem;
font-family: $font-family-sans-serif;
} }
textarea { textarea {

4
dist/mix-manifest.json vendored

@ -1,6 +1,6 @@
{ {
"/scripts/aldine.js": "/scripts/aldine.js?id=c8641d03dfb38dc75e0d", "/scripts/aldine.js": "/scripts/aldine.js?id=c8641d03dfb38dc75e0d",
"/styles/aldine.css": "/styles/aldine.css?id=7e4afced01fd41647dfe", "/styles/aldine.css": "/styles/aldine.css?id=c40439621e3e29db44b3",
"/styles/editor.css": "/styles/editor.css?id=5cb64f625819a8ea0777", "/styles/editor.css": "/styles/editor.css?id=1db52e0f56b8d56e059f",
"/scripts/customizer.js": "/scripts/customizer.js?id=f1f1f4225cba4c1b35f2" "/scripts/customizer.js": "/scripts/customizer.js?id=f1f1f4225cba4c1b35f2"
} }

2
dist/styles/aldine.css vendored

File diff suppressed because one or more lines are too long

2
dist/styles/editor.css vendored

File diff suppressed because one or more lines are too long

13
inc/helpers/namespace.php

@ -131,3 +131,16 @@ function handle_contact_form_submission() {
} }
return; return;
} }
function has_blocks( $post_id ) {
$post_content = get_post_field( 'post_content', $post_id );
if ( ! empty( $post_content ) ) {
if ( strpos( $post_content, 'block--standard' ) || strpos( $post_content, 'block--alternate' ) ) {
return true;
} else {
return false;
}
}
return false;
}

4
partials/content-front-page.php

@ -11,6 +11,7 @@
<?php <?php
use function Aldine\Helpers\has_blocks;
use function Aldine\Helpers\get_catalog_data; use function Aldine\Helpers\get_catalog_data;
$front_page_catalog = get_option( 'pb_front_page_catalog' ); $front_page_catalog = get_option( 'pb_front_page_catalog' );
@ -24,7 +25,8 @@ $next_page = $page + 1;
<div class="blarg"> <div class="blarg">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content"> <?php $classes = ( has_blocks( get_the_ID() ) ) ? 'entry-content blocks' : 'entry-content'; ?>
<div class="<?php echo $classes; ?>">
<?php <?php
the_content(); the_content();
?> ?>

9
partials/content-page.php

@ -9,12 +9,19 @@
?> ?>
<?php
use function Aldine\Helpers\has_blocks;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header"> <header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<div class="entry-content"> <?php $classes = ( has_blocks( get_the_ID() ) ) ? 'entry-content blocks' : 'entry-content'; ?>
<div class="<?php echo $classes; ?>">
<?php <?php
the_content(); the_content();

Loading…
Cancel
Save