Forum Replies Created
-
AuthorPosts
-
December 8, 2022 at 5:13 am in reply to: Genesis Responsive slider Explicit Height and width #506308
glenkg
ParticipantYou are not reacting to my question right? Just to be clear, cause their are no widht or height attributes stated in the code.
glenkg
ParticipantI figured it out..
Only problem I still have is with the submenu that gets off screen and does not scrol down.
glenkg
ParticipantFound a way to do this here: https://ozzyrodriguez.com/tutorials/genesis/genesis-responsive-menu-2-0/
1. making responsive-menu.js file:
( function( window, $, undefined ) { 'use strict'; $( 'nav' ).before( '<button class="menu-toggle" role="button" aria-pressed="false"></button>' ); // Add toggles to menus $( 'nav .sub-menu' ).before( '<button class="sub-menu-toggle" role="button" aria-pressed="false"></button>' ); // Add toggles to sub menus // Show/hide the navigation $( '.menu-toggle, .sub-menu-toggle' ).on( 'click', function() { var $this = $( this ); $this.attr( 'aria-pressed', function( index, value ) { return 'false' === value ? 'true' : 'false'; }); $this.toggleClass( 'activated' ); $this.next( 'nav, .sub-menu' ).slideToggle( 'fast' ); }); })( this, jQuery );
2. put this in function.php and change the prefix in mine:
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_scripts' ); /** * Enqueue responsive javascript * @author Ozzy Rodriguez * @todo Change 'prefix' to your theme's prefix */ function prefix_enqueue_scripts() { wp_enqueue_script( 'prefix-responsive-menu', get_stylesheet_directory_uri() . '/lib/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true ); // Change 'prefix' to your theme's prefix }
3. add the css:
/* Responsive Navigation ---------------------------------------------------------------------------------------------------- */ /* Standard Navigation --------------------------------------------- */ nav { clear: both; } /* Navigation toggles --------------------------------------------- */ .sub-menu-toggle, .menu-toggle { display: none; visibility: hidden; } /* Navigation toggles - Ensure Menu Displays when Scaled Up --------------------------------------------- */ @media only screen and (min-width: 768px) { nav { display: block !important; } } /* Navigation toggles - Mobile (Change max width as you see fit) --------------------------------------------- */ @media only screen and (max-width: 767px) { .menu-toggle, .sub-menu-toggle { display: block; font-size: 20px; font-size: 2rem; font-weight: 700; margin: 0 auto; overflow: hidden; padding: 20px; padding: 2rem; text-align: center; visibility: visible; } button.menu-toggle, button.sub-menu-toggle { background-color: transparent; color: #999; } .sub-menu-toggle { padding: 18px; padding: 1.8rem; position: absolute; right: 0; top: 0; } .menu-toggle:before { content: "\2261"; } .menu-toggle.activated:before { content: "\2191"; } .sub-menu-toggle:before { content: "+"; } .sub-menu-toggle.activated:before { content: "-"; } nav { display: none; position: relative; } .genesis-nav-menu .menu-item { background-color: #f5f5f5; display: block; position: relative; text-align: left; } .genesis-nav-menu .menu-item:hover { position: relative; } .genesis-nav-menu .sub-menu { clear: both; display: none; opacity: 1; position: static; width: 100%; } .genesis-nav-menu .sub-menu a { border-left: 0; position: relative; width: auto; } .genesis-nav-menu .sub-menu .sub-menu { margin: 0; } .genesis-nav-menu .sub-menu .sub-menu a { background-color: #f5f5f5; padding-left: 30px; } .genesis-nav-menu .sub-menu .sub-menu .sub-menu a { background-color: #fff; padding-left: 40px; } .nav-primary a:hover, .nav-primary .current-menu-item > a { color: #333; } }
At first it did not make the hamburger icon collapse, but that was fixed by changing nav into #nav in the responsive-menu.js file and the css. But the submenus are not working because it does not recognize the menu-toggle (I think), the "+" and "-" are not showing or reacting. Any idea how to fix this? Would be greatly appreciated.
glenkg
ParticipantThank you for your answer
glenkg
ParticipantYes thank you, but not all settings are there as seen on the screenshot in the tutorial. So some alterations can not be made in the same way the tutorial said you can.
glenkg
ParticipantYes thank you, I have seen that. But the tutorial said:
The Centric Pro theme demo can be configured to display an image behind the first, third, and sixth home page widget areas.
Navigate to Appearance > Background in your WordPress admin panel.
Use the “Browse” button to select the background image you wish to use from your computer.
Once the image has been selected click the “Upload” button to load the image for use on your site.
Alternatively you can use the “Choose Image” button to select the background image you have loaded to your site previously.
The Display Options settings for Position, Repeat, and Attachment can be set depending on the best settings for the image you have chosen.
To select a Background Color to show around, or instead of a background image in click “Select Color” and choose a color or enter a hexadecimal color code.
Click the “Save Changes” button to preserve your changes.This is not correct if it goes to customize instead where you only can set one background image and the other options are not available. So the tutorial is confusing and it takes time to figure it out, it is not up-to-date the tutorial if it changed.
July 24, 2017 at 6:08 am in reply to: Centric – would like two home widgets to show up on all pages #209522glenkg
ParticipantAha, thanks Victor.
So this will do the trick then:
! ( is_front_page() || is_home() ) && is_active_sidebar( 'home-widgets-5' ) || is_active_sidebar( 'home-widgets-6' )):
Thank you again and have a nice day!
glenkg
ParticipantHi Brad,
Thank you for this option. For now I was able to figure it out with a plugin (Genesis Featured Page Advanced) that gives this as an option, so this threat is solved.
Have a nice day.
glenkg
ParticipantHello Victor,
I understand you completely. Especially when it is a couple of hours of work. I will have a look if I can figure it out myself, I do have time. If there is someone else willing to help, always welcome off course. 🙂
I do want to thank you for your swift answer and wish you a good day Victor.
glenkg
ParticipantHello Victor,
Thank you for your answer. It sounds complex. How should I go about this?
glenkg
ParticipantHello Victor & Brad,
Thank you both so very much for responding so quickly. This worked like a charm. Have a great weekend you both and Thanks again 😉
December 19, 2016 at 6:31 am in reply to: Adding widget content on the end of the secondary navigation menu #197816glenkg
ParticipantI added the line:
$menu .= '<li class="right search">' . $search . '</li>';
and then it shows up twice. One time correctly.
function right_scf ($menu, $args) { $args = (array)$args; if ( 'secondary' !== $args['theme_location'] ) return $menu; ob_start(); dynamic_sidebar('Secondary Right'); $search= ob_get_clean(); $menu .= '<li class="right search">' . $search . '</li>'; return $search . $menu; }
this is how it shows up. the one above the menu has to be disabled:
Do I have to combine the sidebar with the li class? I am close now, but still this lost hurdle..
December 19, 2016 at 5:52 am in reply to: Adding widget content on the end of the secondary navigation menu #197812glenkg
ParticipantHi Disregard the lost question, It was that.
But now it comes above the secondary menu. Is there a way I can get it to appear after the lost menu-item from the secondary menu? Should I make it a menu item of sort? It would be nice if it would be added like that. Is this possible?
thank you
December 19, 2016 at 5:26 am in reply to: Adding widget content on the end of the secondary navigation menu #197810glenkg
ParticipantHi Victor,
Thank you for pointing that out. I changed it
add_filter( 'wp_nav_menu_items', 'right_scf', 10, 2 ); function right_scf ($menu, $args) { $args = (array)$args; if ( 'secondary' !== $args['theme_location'] ) return $menu; ob_start(); dynamic_sidebar('Secondary Right'); $search= ob_get_clean(); return $search . $menu; }
Nothing is happening.. do I still have to add the sidebar?
November 15, 2016 at 8:04 am in reply to: How to add Flexibel content field of Advanced custom fields plugin to genesis #196175glenkg
ParticipantHi Brad, that is the problem.. It is active, but yet it is not showing up. I asked for support at ACF, they looked at the demo page I made especially for this problem, but still it would not show up. I would rather use get_meta, but that also did not work for me or I am doing it wrong. You helped others before with the get_meta code here I saw, and I used that code (with my field name), but still it does not show. Must be some kind of bug, just frustrating that it will just not show up, tried everything, and I don't understand why, just not logical, because I followed all the steps.
Thank you for looking into it at least, I appreciate it. Have a nice day.
November 11, 2016 at 5:35 am in reply to: How to add Flexibel content field of Advanced custom fields plugin to genesis #196022glenkg
ParticipantHi Brad,
Thank you for your answer.
Sorry for the delay, I did not get a notice. The plugin is called advanced custom fields. You can get it for free here: https://wordpress.org/plugins/advanced-custom-fields/. What i want is to getting working with genesis. With the following code I get an error on line 189 (see below the code) . I just don't get why this happens. And at AFC they could not give me a solution as off yet.
I bought this because it allows me to make a page layout with custom fields. The steps to implement the layout are this:
1)Import page-events-acf-export.json in Advnaced Custom Fields
2)Add page_event.php to your child theme
3)Create a page and choose Event page template
4)Publish
4)Advance Custome Fields will be added below page content
5) Choose which fields to addwhich i have all done
These are the ingredients:
flexible_content_field_name = flexible_content
the single template page = page_event.phpin page_event.php the following code:
<?php /* Template Name: Event */ //* Force full width content layout add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); ?> <!-- Add our custom acf loop --> <?php add_action( 'genesis_after_entry_content', 'acf_loop' ); ?> <?php function acf_loop() { ?> <style type="text/css"> .acf-map { width: 100%; height: 400px; border: #ccc solid 1px; margin: 0; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script type="text/javascript"> (function($) { /* * render_map * * This function will render a Google Map onto the selected jQuery element * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param $el (jQuery element) * @return n/a */ function render_map( $el ) { // var var $markers = $el.find('.marker'); // vars var args = { zoom : 16, center : new google.maps.LatLng(0, 0), mapTypeId : google.maps.MapTypeId.ROADMAP }; // create map var map = new google.maps.Map( $el[0], args); // add a markers reference map.markers = []; // add markers $markers.each(function(){ add_marker( $(this), map ); }); // center map center_map( map ); } /* * add_marker * * This function will add a marker to the selected Google Map * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param $marker (jQuery element) * @param map (Google Map object) * @return n/a */ function add_marker( $marker, map ) { // var var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') ); // create marker var marker = new google.maps.Marker({ position : latlng, map : map }); // add to array map.markers.push( marker ); // if marker contains HTML, add it to an infoWindow if( $marker.html() ) { // create info window var infowindow = new google.maps.InfoWindow({ content : $marker.html() }); // show info window when marker is clicked google.maps.event.addListener(marker, 'click', function() { infowindow.open( map, marker ); }); } } /* * center_map * * This function will center the map, showing all markers attached to this map * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param map (Google Map object) * @return n/a */ function center_map( map ) { // vars var bounds = new google.maps.LatLngBounds(); // loop through all markers and create bounds $.each( map.markers, function( i, marker ){ var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() ); bounds.extend( latlng ); }); // only 1 marker? if( map.markers.length == 1 ) { // set center of map map.setCenter( bounds.getCenter() ); map.setZoom( 16 ); } else { // fit to bounds map.fitBounds( bounds ); } } /* * document ready * * This function will render each map when the document is ready (page has loaded) * * @type function * @date 8/11/2013 * @since 5.0.0 * * @param n/a * @return n/a */ $(document).ready(function(){ $('.acf-map').each(function(){ render_map( $(this) ); }); }); })(jQuery); </script> <!-- check if the flexible content field has rows of data --> <?php if( have_rows('flexible_content') ): ?> <!-- loop through the rows of data --> <?php while ( have_rows('flexible_content') ) : the_row(); ?> <!-- button field --> <?php if( get_row_layout() == 'button' ): ?> <a class="button" href="<?php the_sub_field('link'); ?>"><?php the_sub_field('text'); ?></a> <!-- title field --> <?php elseif( get_row_layout() == 'title' ): ?> <h2><?php the_sub_field('title'); ?></h2> <!-- category titles --> <?php elseif( get_row_layout() == 'category_titles'): ?> <h2><?php the_sub_field('category_title'); ?></h2> <!-- column full width --> <?php elseif( get_row_layout() == 'column_whole' ): ?> <div class="acf-columns"> <?php the_sub_field('whole'); ?> </div> <!-- column halfs --> <?php elseif( get_row_layout() == 'columns_half_half' ): ?> <div class="acf-columns"> <div class="one-half first"><?php the_sub_field('half_first'); ?></div> <div class="one-half"><?php the_sub_field('half_last'); ?></div> </div> <!-- columns one third, two thirds --> <?php elseif( get_row_layout() == 'columns_one_third_two_thirds' ): ?> <div class="acf-columns"> <div class="one-third first"><?php the_sub_field('one_third'); ?></div> <div class="two-thirds"><?php the_sub_field('two_thirds'); ?></div> </div> <!-- columns two thirds, one third --> <?php elseif( get_row_layout() == 'columns_two_thirds_one_third' ): ?> <div class="acf-columns"> <div class="two-thirds first"><?php the_sub_field('two_thirds'); ?></div> <div class="one-third"><?php the_sub_field('one_third'); ?></div> </div> <!-- columns thirds --> <?php elseif( get_row_layout() == 'columns_one_third_one_third_one_third' ): ?> <div class="acf-columns"> <div class="one-third first"><?php the_sub_field('one_third_first'); ?></div> <div class="one-third"><?php the_sub_field('one_third_middle'); ?></div> <div class="one-third"><?php the_sub_field('one_third_last'); ?></div> </div> <!-- google map (two thirds), content area (one third) --> <?php elseif( get_row_layout() == 'google_map_content' ): ?> <div class="acf-columns"> <div class="two-thirds first"> <?php $location = get_sub_field('google_map'); if( !empty($location) ): ?> <div class="acf-map"> <div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div> </div> <?php endif; ?> </div> <div class="one-third"><?php the_sub_field('map_content'); ?></div> </div> <!-- content area (one third), google map (two thirds) --> <?php elseif( get_row_layout() == 'google_content_map' ): ?> <div class="acf-columns"> <div class="one-third first"><?php the_sub_field('map_content'); ?></div> <div class="two-thirds"> <?php $location = get_sub_field('google_map'); if( !empty($location) ): ?> <div class="acf-map"> <div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div> </div> <?php endif; ?> </div> </div> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <!-- no layouts found --> <?php endif; ?> <?php } ?> <?php //* Run the Genesis loop genesis();
THE ERROR:
Fatal error: Call to undefined function have_rows() in D:\xamppwordpress\htdocs\mooidordrecht\wp-content\themes\mooidordrecht\page_event.php on line 189
Line 189 :
<?php if( have_rows('flexible_content') ): ?>
Is this helpful to understanding where the problem might be?
Hope this helps. Thank you.
-
AuthorPosts