• 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

DragNfLy

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 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • July 10, 2020 at 7:02 am in reply to: Enable Page Attributes #500060
    DragNfLy
    Member

    Nope,

    If you do not have the starter pack installed, the Attributes section is not available.

    May 21, 2014 at 10:13 am in reply to: rel=”alternate” #106169
    DragNfLy
    Member

    Yes, the 'add_action' calls this to 'head' of the page.

    My scenario is a workaround as I am targeting 2 different languages for the same region. LOL > South Africa has 11 official languages. #hreflangnightmare

    I would imaging there would be a different method for multi-region.

    May 20, 2014 at 7:41 am in reply to: rel=”alternate” #106003
    DragNfLy
    Member

    Hi @samw

    Yes, i did it the long way round, which is probably exactly what you require.

    Code below in functions.php:

    // MY REL ALTERNATE
    add_action( 'wp_head', 'rel_alternate' );
    
    function rel_alternate() {
    
    // Insert Rel=Alternate if post is
    
      if ( is_single( '820') ) {
    	echo '<link rel="alternate" hreflang="af" href="#" />'.PHP_EOL;
    	}
    
      elseif ( is_single( '9150') ) {
    	printf( '<link rel="alternate" hreflang="af" href="#" />').PHP_EOL;
    	}
    }

    I then add the Canonical URL to the Page settings 'Custom Canonical URL'

    ...and also exclude the 'hreflang page' from my Sitemap
    I use the XML Sitemap & Google News feeds plugin which adds a 'Exclude from XML Sitemap' field to each post in the righ-hand sidebar.

    I am not sure if this is the correct way of doing this.

    Good luck
    🙂

    April 5, 2014 at 6:01 am in reply to: rel=”alternate” #98608
    DragNfLy
    Member

    Thanks for your reply.

    The Advanced Custom Post Type Repeater Addon is $25.00 AUD. So I'd rather follow my example above even though there are several pages; 30+ that will require hreflang tags.

    I am however trying to get my head around the repeater fields. How would these hook into wp_head .

    This feature would be great addition to the 'Theme SEO settings tab' in Genesis the same way they offer to do 'Canonical'.... an afterthought for your plugin idea.

    Thanks again

    April 3, 2014 at 7:18 pm in reply to: rel=”alternate” #98384
    DragNfLy
    Member

    Hi Susan / Forum

    I have been battling with this and have created a custom function to hook into wp_head.

    Can anyone please let me know if this is the correct way to do this.

    // Rel Alt Function
    add_action( 'wp_head', 'rel_alternate' );
    
    function rel_alternate() {
    
    // Insert Rel=Alternate if post is
      if ( is_single( '150') ) {
    	echo '<link rel="alternate" hreflang="af" href="#">';
    	}
    
      elseif ( is_single( '152') ) {
    	echo '<link rel="alternate" hreflang="af" href="#">';
    	}
    }

    Any comments welcome

    March 10, 2014 at 5:15 pm in reply to: rel=”alternate” #94217
    DragNfLy
    Member

    Hi Forum

    I would appreciate some assistance re. the above issue. Any ideas?

    Many Thanks

    February 23, 2014 at 3:37 pm in reply to: rel=”alternate” #92048
    DragNfLy
    Member

    Hi Susan

    I would appreciate some assistance re. the above issue.

    Many Thanks

    November 27, 2012 at 1:17 pm in reply to: Different Header Image on Post #1910
    DragNfLy
    Member

    Hi SoZo

    Body class was the give-away there.  FireBug revealed it as postid-6450 and not post-id-6450.

    Thanks a mill.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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