• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Gary Jones

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 20 posts - 41 through 60 (of 493 total)
← 1 2 3 4 … 23 24 25 →
  • Author
    Posts
  • February 26, 2018 at 3:21 am in reply to: conditional when using genesis simple menu as secondary menu #217013
    Gary Jones
    Member

    has_nav_menu( 'secondary' ) may be the bit you're missing here.

    Untested, but try:

    
    add_action( 'genesis_entry_footer', 'bill_related_links' );
    /**
     * Add "Related Links" title just above secondary menu in footer.
     */
    function bill_related_links () {
    	if ( is_singular( array ('page','mycpt') ) && has_nav_menu( 'secondary' ) ) {
    		echo( '<strong>Related Searches:</strong>' );
    	}
    }
    
    // Reposition the secondary navigation menu to below content.
    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    add_action( 'genesis_entry_footer', 'genesis_do_subnav' );
    

    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 26, 2018 at 3:14 am in reply to: About JSON-LD in Genesis Themes #217012
    Gary Jones
    Member

    Angelo,

    The existing schema attributes are added via the lib/functions/markup.php file.

    You can use this solution to remove the microdata attributes.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 15, 2018 at 4:06 am in reply to: Which Plugins Do You Use? #216574
    Gary Jones
    Member

    There is no standard set of plugins - each site is different and require different things. People have their favourites which they install on each site _they_ do though.

    In terms of SEO, there are a few (and most are better than Genesis SEO), but Yoast SEO tends to be the most popular.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 15, 2018 at 4:01 am in reply to: Genesis updated with modern CSS code? = Flexbox for column layouts for example? #216573
    Gary Jones
    Member

    Your best bet is to try and get it into https://github.com/copyblogger/genesis-sample 😉


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 15, 2018 at 3:51 am in reply to: Username as email address #216572
    Gary Jones
    Member

    Click on your name / avatar top left, then Edit, and choose a different display name.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 4, 2018 at 11:48 am in reply to: About JSON-LD in Genesis Themes #216071
    Gary Jones
    Member

    The advice is generally to have only one form of semantic data, so if you add JSON LD, then yes, I'd recommend you remove the microdata attributes as well.

    See lib/functions/markup.php for where the microdata attributes are added in via a filter (so you can add your own filters to remove them, or remove_filter() when the filter *only* contains microdata attributes).


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 7, 2017 at 9:27 am in reply to: Responsive YouTube videos #202640
    Gary Jones
    Member

    http://fitvidsjs.com/


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 7, 2017 at 9:26 am in reply to: Responsive Tables? #202639
    Gary Jones
    Member

    See https://futuresonline.com/education/products/margin-requirements as an example.

    Add the table as normal, but add data-label attributes to td elements. Then, when viewing in a narrow screen, use CSS, to show these attributes as content on screen with ::before.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 7, 2017 at 9:19 am in reply to: Genesis compatibility with PHP 7.0 #202637
    Gary Jones
    Member

    These are only warnings from PHPCS and they can be ignored here. PHP won't ever introduce native functions that start with __genesis_. Genesis works absolutely fine with PHP 7.0.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    December 24, 2016 at 5:10 pm in reply to: SSL Website Not Totally Secure? #198084
    Gary Jones
    Member

    https://github.com/bramus/mixed-content-scan

    Or https://developers.google.com/web/fundamentals/security/prevent-mixed-content/fixing-mixed-content

    Or https://scotthelme.co.uk/fixing-mixed-content-with-csp/


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    December 24, 2016 at 5:05 pm in reply to: Caching Plugins #198083
    Gary Jones
    Member

    I'd recommend WP Rocket, and if you're hosting on SiteGround, the SGCachePress plugin.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    May 13, 2016 at 3:16 pm in reply to: Problems with an wrap :-S #185590
    Gary Jones
    Member

    Too much Plugins will kill the Pagespeed.

    I'm afraid you're wrong. Too many badly coded plugins will affect performance.

    Plugins which do lots of database complex reads and writes, or disk IO (reading and writing from the filesystem), or makes external requests (interacts with some 3rd party service) - they are the ones that cause a site to slow down.

    A plugin which just holds the same snippet of code that you'd otherwise put into theme's functions.php, has no performance impact at all, compared to keeping that snippet in functions.php. Plugin which just register a post type, hook a function call in somewhere, add in some admin change or whatever, are all light - you could easily have (and I have my own site and client sites that do) 60-100 plugins of these very specific plugins, because having them as small modules make them easier to manage.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    May 9, 2016 at 1:32 am in reply to: Problems with an wrap :-S #185253
    Gary Jones
    Member

    > But i don't like plugins. I preferred function and working dirrectly in the code.

    There is nothing wrong with having code in a plugin. They aren't special in any way - it's just a different file to keep related logic in. Having code in plugins is usually far more advantageous then stuff it all into functions.php.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    May 8, 2016 at 10:32 am in reply to: Problems with an wrap :-S #185185
    Gary Jones
    Member

    Your CSS could include a selector that only targets the page template class that is added to the body element.

    .page-template-default ... {
       ...
    }

    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 27, 2016 at 3:39 pm in reply to: Sidebar Menu Visibility #182337
    Gary Jones
    Member

    This wouldn't be a setting unless you have a plugin that handles this exact intent.

    I'd suggest looking in the theme for where the menu is output (assuming not via a widget), and see if it checks for permissions there.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 27, 2016 at 3:36 pm in reply to: Did I make a coding mistake? Any Alternatives? #182336
    Gary Jones
    Member

    I'd restructure it slightly differently:

    <?php
    
    // Requires at least PHP 5.4 for the shorthand array syntax.
    
    // Define where our view files are.
    // The constant prefix should represent the theme. Here, I've pretended the theme is called 'jamesparkin'.
    define( 'JAMESPARKIN_VIEW_DIR', trailingslashit( get_stylesheet_directory() ) . 'views/' );
    
    add_action( 'widgets_init', 'jamesparking_register_header_widgets' );
    /**
     * Register custom widget areas.
     * 
     * Note that this function name has a prefix, and an action - registering something. Functions should do something,
     * so try and name them with a verb.
     */
    function jamesparking_register_header_widgets() {
    	// Keep the data separate from what we do with the data for as long as possible.
    	// This array could be extracted into its own function, or a config file, or filtered before using it etc.
    	// Note that text domains should match with the theme slug - they should not be 'genesis'.
    	$widget_areas = [
    		[
    			// Nicely align to = characters make it all much easier to read.
    			// ID can be hyphenated to make it easier to read too.
    			'id'          => 'jamesparkin-header-left',
    			'name'        => __( 'CTA Widget Header Left', 'jamesparkin' ),
    			// You could be more verbose with these descriptions. Give a clue as to what widgets can work well
    			// in each of these widget areas, for instance. Just repeating the widget area title isn't helpful.
    			'description' => __( 'This is for the CTA Widget Left', 'jamesparkin' ),
    		],
    		[
    			'id'          => 'jamesparkin-header-middle',
    			'name'        => __( 'CTA Widget Header Middle', 'jamesparkin' ),
    			'description' => __( 'This is for the CTA Widget Middle', 'jamesparkin' ),
    		],
    		[
    			'id'          => 'jamesparkin-header-right',
    			'name'        => __( 'CTA Widget Header Right', 'jamesparkin' ),
    			'description' => __( 'This is for the CTA Widget Right', 'jamesparkin' ),
    		],
    	];
    
    	// Now loop through the data and use it to register sidebars.
    	array_walk( $widget_areas, function( $widget_area ) {
    		// Use genesis_register_widget_area() - does the same thing as genesis_register_sidebar(), but it helps to
    		// think of these as widget areas which may not be displayed as a bar on the side of content.
    		genesis_register_widget_area( $widget_area );
    	} );
    }
    
    add_action( 'genesis_before_content', 'jamesparkin_display_header_widgets', 5 );
    /**
     * Display call to action header widgets.
     */
    function jamesparkin_display_header_widgets() {
    	// Return early, makes code easier to follow.
    	if ( ! is_home() ) {
    		return;
    	}
    
    	// Don't have HTML stuffed into PHP strings. Have syntax-highlightable and front-end-developer-editable
    	// HTML in simple files, and just include them where needed.
    	include JAMESPARKIN_VIEW_DIR . 'header-widgets.php';
    }
    ?>
    <!-- wp-content/themes/jamesparkin/views/header-widgets.php -->
    <div class="header-widgets">
    	<div class="wrap">
    		<!--
    		Refer to output classes as -1, -2, -3, not left, middle, right as
    		responsive design means they may not be shown in those positions.
    		-->
    		<div class="header-widget header-widget-1">
    			<?php echo genesis_widget_area( 'jamesparkin-header-left' ); ?>
    		</div>
    		<div class="header-widget header-widget-2">
    			<?php echo genesis_widget_area( 'jamesparkin-header-middle' ); ?>
    		</div>
    		<div class="header-widget header-widget-3">
    			<?php echo genesis_widget_area( 'jamesparkin-header-right' ); ?>
    		</div>
    	</div>
    </div> <!-- This final /div was missing from the code you posted. -->

    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    March 27, 2016 at 3:05 pm in reply to: Breadcrumb day format #182334
    Gary Jones
    Member

    Hi Jose,

    There's a filter right below the line you quoted, and you can use that to filter the crumb, so that the last two characters from the crumb are removed. Give the following a go - drop it at the end of your functions.php:

    add_filter( 'genesis_day_crumb', function( $crumb ) {
    	return substr( $crumb, 0, -2 );
    } );

    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 13, 2016 at 10:14 am in reply to: How Do I Include Image ALT Tags in Common Theme Images? #178965
    Gary Jones
    Member

    Images in themes tend to be shown as background images, and therefore don't require alt attributes (not tags). They do not contribute to the content of the site, and therefore no alternative representation needs to be given.

    For the example you've given, even if it is displayed inline (which would be less than ideal), the alt attribute should be an empty string (alt=""). It is purely for visual design, and again, has no bearing on the content and so no alternative text is needed. If you did give it, then screen readers would read out the redundant text and that would just distract from the actual content.

    The main thing to consider here, is that alt attributes re for human screen reader users. Any SEO benefit is most definitely a secondary factor, so trying to cater for SEO first will give poor results for your visitors.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    September 22, 2014 at 4:05 am in reply to: Multiple body classes ignored for CPT #125283
    Gary Jones
    Member

    genesis/lib/structure/layout.php, around line 176, you should see:

    $classes[] = esc_attr( sanitize_html_class( $new_class ) );

    inside a function called genesis_cpt_archive_body_class. Can you please change that line to:

    $classes[] = esc_attr( $new_class );

    And see if that fixes the problem?


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    September 22, 2014 at 3:09 am in reply to: Multiple body classes ignored for CPT #125280
    Gary Jones
    Member

    At this moment in time, what you're seeing is intended behaviour. If you want to add multiple classes, you'll need to filter them in with code, not the UI.

    However, I will make a suggestion to core developers that space-separation of multiple class is supported.


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

  • Author
    Posts
Viewing 20 posts - 41 through 60 (of 493 total)
← 1 2 3 4 … 23 24 25 →
« Previous Page

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble