Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ltw templates #154

Merged
merged 5 commits into from
Jun 26, 2020
Merged

Custom ltw templates #154

merged 5 commits into from
Jun 26, 2020

Conversation

joshdarby
Copy link

Changes

This pull request makes the following changes:

  • Adds a new template template-page-ltw.php to use for LTW pages that includes no header or navigation and only a reduced logo
  • Updates the archive-projects.php archive template to match the look of the new template above
  • Creates new stylesheet for said template
  • Registers new current-ltw-template-stylesheet script and enqueues it where necessary

Shortcode page:
screencapture-currentorg-test-local-projects-2020-06-25-13_43_03

Archive:
screencapture-currentorg-test-local-that-works-2020-06-25-13_43_22

Form page:
screencapture-currentorg-test-test-form-page-2020-06-25-13_43_12

Why

For #153

Testing/Questions

Features that this PR affects:

  • Archive template for LTW Projects CPT
  • New custom template

Questions that need to be answered before merging:

  • Is this PR targeting the correct branch in this repository?
  • I thought about making archive-projects.php just include this new template, but then we'd need to make a ton of conditionals inside of it to distinguish between archive vs. page, and also I wasn't sure if they're ever going to want them to look different. Does it make sense to keep them separate but equal for now?
  • Does the header size look ok @MirandaEcho?

Steps to test this PR:

  1. View the LTW archive page and make sure everything still works ok
  2. Create a page, add the LTW shortcode to it, and select the new template. View it and make sure everything looks and functions ok

@joshdarby joshdarby added this to the INOV-001 milestone Jun 25, 2020
@joshdarby joshdarby self-assigned this Jun 25, 2020
@joshdarby joshdarby changed the base branch from master to staging June 25, 2020 17:58
@benlk
Copy link
Collaborator

benlk commented Jun 25, 2020

Screen Shot 2020-06-25 at 15 36 13

Did you know that the Gutenberg editor, in the background, renders shortcodes displayed in the editor?

diff --git a/wp-content/themes/currentorg/partials/projects-single-held.php b/wp-content/themes/currentorg/partials/projects-single-held.php
index a3ba61a..26bf5cd 100644
--- a/wp-content/themes/currentorg/partials/projects-single-held.php
+++ b/wp-content/themes/currentorg/partials/projects-single-held.php
@@ -71,7 +71,7 @@ if( ! empty ( $custom['project-video'][0] ) ) {
                     esc_attr( $term->slug ),
                     // @todo: make this be a link that triggers the search filter for this term
                     get_term_link( $term ),
-                    esc_html( $term->name ),
+                    esc_html( $term->name )
                 );
                 if( $terms_index != $terms_count ){
                     echo '<span class="delimiter">' . $delimiter . '</span>';
@@ -133,7 +133,7 @@ if( ! empty ( $custom['project-video'][0] ) ) {
         if ( ! empty( $custom['project-contact-name'][0] ) || ! empty( $custom['project-contact-email'] ) ) {
             printf(
                 '<label class="project-single-contact">%1$s: </label>',
-                __( 'Contact', 'current-ltw-projects' ),
+                __( 'Contact', 'current-ltw-projects' )
             );
         }
 
@@ -182,4 +182,4 @@ if( ! empty ( $custom['project-video'][0] ) ) {
 
         ?>
     </div>
-</article>
\ No newline at end of file
+</article>

fixes this error.

@benlk
Copy link
Collaborator

benlk commented Jun 25, 2020

Upgrading to PHP 7.3 fixes it as well.

Copy link
Collaborator

@benlk benlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that doesn't concern this PR but which we'll want to remove eventually:

add_action('largo_before_post_header', function() {
printf(
'<pre>%1$s</pre>',
esc_html( var_export( get_post_custom( get_the_ID() ), true) )
);
});

It's debug code, and it's appearing on posts. http://staging.current.flywheelsites.com/2020/05/reflections-from-observing-good-radio-bosses/

@joshdarby joshdarby merged commit 443d2f6 into staging Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants