• 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

Modify Credits URL for Dynamic Display

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

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Modify Credits URL for Dynamic Display

This topic is: not resolved

Tagged: blog url, credits

  • This topic has 8 replies, 3 voices, and was last updated 5 years, 2 months ago by Brad Dalton.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • February 13, 2017 at 2:37 pm #201074
    bamajr
    Member

    Full disclosure...

    I'm modifying a script found at: http://my.studiopress.com/documentation/snippets/footer/customize-the-credits-text/

    
    //* Change the footer text
    add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
    function sp_footer_creds_filter( $creds ) {
    	$creds = 'Copyright [footer_copyright] &middot; <a href="SITE-URL">SITE-NAME</a> &middot; All Rights Reserved &middot; [footer_loginout]';
    	return $creds;
    }
    
    

    This script works great in a stand-alone WordPress installation, but what if the theme is being used on multiple sites, within a multi-site network? I'd like to be able to call the SITE-URL in the "href=" area and call the SITE-NAME in the "My Custom Link" area, so the SITE-URL and SITE-NAME change automatically, when a new site is added to the multi-site network.

    The Genesis filter reference doesn't seem to mention anything about an ability to add SITE-URL or SITE-NAME to the genesis_footer_creds_text. Any thoughts?


    Online at https://bamajr.com, https://google.com/+Bamajr and https://twitter.com/bamajr

    https://itsallundercontrol.com/
    February 13, 2017 at 2:53 pm #201075
    Brad Dalton
    Participant

    You can modify the code and change the site name and URL.


    2700 Genesis Tutorials

    February 13, 2017 at 3:16 pm #201078
    Victor Font
    Moderator

    Create shortcodes to retrieve the site name and url, then use them in your snippet. SITE-URL and SITE-NAME are not PHP contants unless you define them as such in your theme. If they were defined, they wouldn't be SITE-URL and SITE-NAME anyway. They would be SITE_URL and SITE_NAME. The way multisite works, you would either have include the shortcodes in every theme on the site or use a multisite compatible snippet plugin like WP Clips that would auto-load the shortcodes on every site. You can try this to see if it gets started. The shortcodes woul be [display_site_url] and [display_site_name]

    add_shortcode( 'display_site_url', 'ms_display_site_url' );
    function ms_display_site_url() {
        echo  site_url();
    }
    
    add_shortcode( 'display_site_name', 'ms_display_site_name' );
    function ms_display_site_name() {
        bloginfo( 'name' );
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 14, 2017 at 2:39 pm #201177
    bamajr
    Member

    Thank you for chiming in @braddalton - always a pleasure.

    Yes, I do know how to modify the script to display a specific Site-Name, on all sites within the multi-site network. However, I'm not able to make it dynamically change, with each new website on the multi-site network.


    Online at https://bamajr.com, https://google.com/+Bamajr and https://twitter.com/bamajr

    February 14, 2017 at 2:39 pm #201178
    bamajr
    Member

    Thank you @VictorFont. I think that will work!


    Online at https://bamajr.com, https://google.com/+Bamajr and https://twitter.com/bamajr

    February 14, 2017 at 2:55 pm #201180
    bamajr
    Member

    @VictorFont This didn't work as expected, but I am much closer.

    I have modified the script as follows:

    
    add_shortcode( 'display_site_url', 'ms_display_site_url' );
    function ms_display_site_url() {
        echo  site_url();
    }
    
    add_shortcode( 'display_site_name', 'ms_display_site_name' );
    function ms_display_site_name() {
        bloginfo( 'name' );
    }
    
    //* Change the footer text
    add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
    function sp_footer_creds_filter( $creds ) {
    	$creds = 'Copyright [footer_copyright] &middot; <a href="[display_site_url]">[display_site_name]</a> &middot; All Rights Reserved &middot; [footer_loginout]';
    	return $creds;
    }
    

    ...and it returns this:

    
    HTTPS://TEST.CARETOPLAN.NET/7F011FF0-510D-450D-9BD1-2CD5D89A88E9ALZHEIMER'S SPEAKS (CTP)
    COPYRIGHT © 2017 · · ALL RIGHTS RESERVED · MY WEB MGMT CO. · LOG OUT
    

    I figure I'm not escaping something correctly but trying to modify this has resulted in WordPress' beloved WSoD 😉


    Online at https://bamajr.com, https://google.com/+Bamajr and https://twitter.com/bamajr

    February 15, 2017 at 4:11 am #201202
    Brad Dalton
    Participant

    How about something like this


    2700 Genesis Tutorials

    February 23, 2017 at 10:32 am #201823
    bamajr
    Member

    Thank you Mr. Dalton.

    I actually searched your website for a solution to this but never found the solution you linked.


    Online at https://bamajr.com, https://google.com/+Bamajr and https://twitter.com/bamajr

    February 23, 2017 at 12:19 pm #201830
    Brad Dalton
    Participant

    Link works. Try this


    2700 Genesis Tutorials

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

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