Community Forums › Forums › Archived Forums › Design Tips and Tricks › Php help please
- This topic has 1 reply, 1 voice, and was last updated 6 years ago by
jbculp.
-
AuthorPosts
-
May 12, 2017 at 11:33 am #206338
jbculp
ParticipantOK, I'm stuck. I hate to slam a bunch of code here but I can't figure this out. I support a WordPress site on a custom Genesis theme I didn't create. In short, the creators of this theme seemed to dice it all up into sections of code. The main content area of a given page is divided into two columns. Now the client wants to put in a full width set of content. Their intention is to put an iFrame into the area to span the whole width. Without customization, the iFrame slams into a small column on the left (the result of the split mentioned above). What I can't figure out is how to deactivate the split on that one page. In my test version I got the iFrame in before the content section (hard coded in the PHP for testing) but behind it is the dotted line separating the columns and a huge amount of dead space under the iFrame.
Here is the original code that leads up to the columns:
* ! Loop Customizations */ add_action('genesis_before_loop', 'dmeyers_pre_loop'); function dmeyers_pre_loop() { if (is_page()) { // overide the Genesis loop remove_action('genesis_loop', 'genesis_do_loop'); add_action('genesis_loop', 'dmeyers_page_loop'); } else { // open columns markup dmeyers_open_columns(); // add post hook for conditional customizations add_action('genesis_before_post', 'dmeyers_before_post'); add_action('genesis_after_post', 'dmeyers_post_reset'); // close the columns after the loop add_action('genesis_after_loop', 'dmeyers_close_columns'); } } /* ! Columns Markup */ function dmeyers_open_columns() { ?> <div class="columns"> <div class="column-blurb"> </div> <!-- end .blurb --> <div class="column-featured"> <?php } function dmeyers_close_columns() { ?> </div> <!-- end .column-featured --> </div> <!-- end .columns --> <?php }
And here is my version. You see I'm calling the new page template and the iFrame first but further down I've tried to deactivate the columns section on page ID 1028 but it doesn't work. I have the 1028 ID in two places. What I really want is this:
If page template = x do this, otherwise do your normal loop as defined by this custom theme.
My Code that only 1/2 works:* ! Loop Customizations */ add_action('genesis_before_loop', 'dmeyers_pre_loop'); function dmeyers_pre_loop() { if (is_page_template( 'jbagley.php' )) { echo '<div class="jbagley"><iframe src="http://johnbagleyusa.com/retailer/?jbid=g475u2t5d8c4b1j5y8r7spe34nm5b7y29" style="width:100%;height:900px;border:none"></iframe><br /></div>'; remove_action('genesis_loop', 'genesis_do_loop'); add_action('genesis_loop', 'dmeyers_page_loop'); } elseif (is_page () && !is_page(1028)) { // overide the Genesis loop remove_action('genesis_loop', 'genesis_do_loop'); add_action('genesis_loop', 'dmeyers_page_loop'); } else { // open columns markup (is_page () && !is_page(1028)); dmeyers_open_columns(); // add post hook for conditional customizations add_action('genesis_before_post', 'dmeyers_before_post'); add_action('genesis_after_post', 'dmeyers_post_reset'); // close the columns after the loop add_action('genesis_after_loop', 'dmeyers_close_columns'); } } /* ! Columns Markup */ function dmeyers_open_columns() { ?> <div class="columns"> <div class="column-blurb"> </div> <!-- end .blurb --> <div class="column-featured"> <?php } function dmeyers_close_columns() { ?> </div> <!-- end .column-featured --> </div> <!-- end .columns --> <?php }
Again, I'm sorry to include all this code. I hope someone can fish thru this and help.
http://dmeyersjeweler.com/john-bagley/
jcMay 12, 2017 at 4:48 pm #206360jbculp
ParticipantI'm rethinking my lack of understanding about some aspects of the Php in this request so am withdrawing my support request.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.