Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
Sooo i have created an everblox page template to allow regular pages …
Browse files Browse the repository at this point in the history
…to be created as plugins cant use the everblox system so things break, so rather than everyone fighting, its now the wordpress way allowing plugins like woocommerce to play nicely. therefore deleted unnessesary page.php then freed up index.php to be the as intended fallback template if no other templates are found. best look at the wp hierarchy for more on this. hidden block development ACF section from page views now so only see in the ACF admin. removed some legacy blocks scss. created home.php as its the native home the blog. up next is to fix archive.php and single.php
  • Loading branch information
onefastsnail committed Feb 6, 2018
1 parent 718b607 commit 9518154
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 228 deletions.
11 changes: 2 additions & 9 deletions acf-json/group_54ddebcd1dfe7.json
Expand Up @@ -1642,16 +1642,9 @@
"location": [
[
{
"param": "post_type",
"param": "post_taxonomy",
"operator": "==",
"value": "page"
}
],
[
{
"param": "post_type",
"operator": "==",
"value": "post"
"value": "product_visibility:rated-5"
}
]
],
Expand Down
4 changes: 3 additions & 1 deletion archive.php
@@ -1,4 +1,6 @@
<?php get_header();
<?php

get_header();

// check our current post type
$type = (empty(get_post_type()) || get_post_type() == 'post')? 'blog' : get_post_type();
Expand Down
135 changes: 0 additions & 135 deletions assets/scss/blocks/_b-image-text.scss

This file was deleted.

23 changes: 0 additions & 23 deletions assets/scss/blocks/_b-image.scss

This file was deleted.

39 changes: 0 additions & 39 deletions assets/scss/blocks/_b-listing.scss

This file was deleted.

3 changes: 0 additions & 3 deletions assets/scss/main.scss
Expand Up @@ -74,9 +74,6 @@ $fa-font-path: "../../node_modules/font-awesome/fonts";
@import "blocks/b-base";
@import "blocks/b-blog";
@import "blocks/b-footer";
@import "blocks/b-image-text";
@import "blocks/b-image";
@import "blocks/b-listing";
@import "blocks/b-page-content";
@import "blocks/b-page-navigation";
@import "blocks/b-section";
Expand Down
9 changes: 9 additions & 0 deletions home.php
@@ -0,0 +1,9 @@
<?php

// this template is for the blog posts index

get_header();

include(get_template_directory().'/templates/blog/index.php');

get_footer();
24 changes: 21 additions & 3 deletions index.php
@@ -1,5 +1,23 @@
<?php get_header();
<?php

include(locate_template('archive.php'));
// this is the fallback template file if no other templates in the hierarchy are found

get_footer();
get_header();

?>

<section class="section">
<div class="container">
<div class="row">
<div class="col-xs-12">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div><!-- end of row -->
</div><!-- end of wrapper -->
</section><!-- end of section -->

<?php get_footer();
17 changes: 5 additions & 12 deletions lib/functions/acf.php
Expand Up @@ -140,19 +140,12 @@ function registerLocalBlockFieldGroups(){
'layouts' => $layouts,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
),
),
array (
array (
'param' => 'post_type',
'location' => array(
array(
array(
'param' => 'post_template',
'operator' => '==',
'value' => 'post',
'value' => 'page-everblox.php',
),
),
),
Expand Down
23 changes: 22 additions & 1 deletion lib/hooks.php
Expand Up @@ -21,7 +21,28 @@ function register_my_menus() {
}

function custom_post_types_editing() {
remove_post_type_support( 'page', 'editor' );

$postId = false;

// get our POST from the URL or post payload
if( isset( $_GET['post'] ) )
$postId = $_GET['post'];
elseif( isset( $_POST['post_ID'] ) )
$postId = $_POST['post_ID'];

$postId = intval( $postId );

if( ! $postId )
return;

if ( isset( $postId ) ) {
$template = get_post_meta( $postId, '_wp_page_template', true );

// if the Everblox template then hide the editor as we dont need it
if ('page-everblox.php' === $template ) {
remove_post_type_support( 'page', 'editor' );
}
}
}

function custom_mce_em_buttons() {
Expand Down
5 changes: 4 additions & 1 deletion page-em.php
@@ -1,4 +1,7 @@
<?php

// this is the evermade toolbox, with style guides etc

get_header();

if(!isset($_GET['t'])) {
Expand Down Expand Up @@ -40,4 +43,4 @@

?>

<?php get_footer();
<?php get_footer();
2 changes: 1 addition & 1 deletion page.php → page-everblox.php
@@ -1,6 +1,6 @@
<?php
/*
Template Name: Page Blocks
Template Name: Everblox
*/

get_header();
Expand Down

0 comments on commit 9518154

Please sign in to comment.