• Hi there,
    I’ve decided to bite the bullet & learn PHP! To do this I’m following a set of tutorials to create new page useing ACF and I’m getting a blank screen (code below)!
    Firstly: In the tutorial there is a line:
    add_theme_support( 'genesis-structural-wraps', array( 'header', 'footer-widgets', 'footer', 'nav', 'subnav', ) );
    I haven’t got clue what this is or how to point it at Harmonic – Help please!

    Secondly: When I try to look at the page I get a blank screen, F12 also shows no style sheets – again, help please!!
    Many thanks

    Code (in it’s own file):

    <?php
    
    /**
     * Template Name: HomePageNewPaul1
     */
    
    add_action('full_width_content','do_full_width_content');
    
    add_filter('body_class', 'add_full_width_body_class' );
    function add_full_width_body_class($classes){
        
         $classes[] = 'full-width-template';
     
     return $classes;
     
    }
    
    function do_full_width_content() {
    
    ?>
    
    <main>
        
    <?php
        
     // check if the flexible content field has rows of data 
     
    if( have_rows('flexible_content') ):
     
      // loop through the rows of data
        while ( have_rows('flexible_content') ) : the_row(); 
     
      // check current row layout 
             if( get_row_layout() == 'hero' ):?>   
                 
                  <section>
                     <div class='hero' style="background-image:url(<?php the_sub_field('flexible_image')?>)"></div>
                    
                     
                 </section>
       
        
        
       endif;
    
    endwhile;
    
    else:
    
        //do something
    
        endif;
    
    ?>
    
    </main>
    
    <?php
    
     
     
     get_header();
    
    do_action('full_width_content');
    
     get_footer();

    Added to style.css:

        #full_width_template .site_inner{
        max-width:100%;
        padding: 0;
    }
    /* Section 1 -- Hero Section */ 
    .hero {
     background-size: cover;
     background-position: center;
    }
     
    .cta_container {
     text-align: center;
     vertical-align: middle;
     background-color: rgba(0, 0, 0, 0.52);
     background: rgba(0, 0, 0, 0.52);
     color:rgba(0, 0, 0, 0.52);
    }
     
    .cta_content {
     padding: 100px 10px;
     color: white;
    }

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Hi there, first off, Harmonic does not use the Genesis Framework, so you need to not use this.
    add_theme_support( 'genesis-structural-wraps', array( 'header', 'footer-widgets', 'footer', 'nav', 'subnav', ) );

    What exactly are you trying to accomplish with this change? It might be that there is a plugin that will do it, or perhaps another way that will not require burying yourself in php.

    Thread Starter ageingdj

    (@ageingdj)

    Hi there,
    Thanks for your reply.
    I was following a [beginners] tutorial on using php & ACF to create a page template and this line of code appeared with no explanation over what is was, what it did or wether I needed it or not – totally confusing!
    (I keep getting a blank screen whether I use this code or not)

    Many thanks

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Hooray and you are welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two php questions’ is closed to new replies.