• 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

Putting custom field into footer area

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 › General Discussion › Putting custom field into footer area

This topic is: not resolved

Tagged: custom field footer, customise footer

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 2 months ago by nutsandbolts.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • November 19, 2013 at 11:25 am #74200
    TraceyR
    Member

    Hi folks,

    A custom field has been created that needs to be shown in the footer of a site I'm supporting, using Genesis and Lifestyle theme, but I can't get the PHP to work correctly in the functions.php file, where I customise the footer credits section

    Existing code:
    add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
    function custom_footer_creds_text($creds) {
    $creds = '<span style="font-size:12px;"> [footer_copyright] ' . get_bloginfo('name') . ' • Company Number 6358281 • All Rights Reserved • <br /> •
    <span style="color: #e3e3e3;">PRIVACY POLICY</span> • </span> •
    <span style="font-size:10px;">Website by: <span style="color: #e3e3e3;">The Simple Web Company</span> • <span style="color: #e3e3e3;"><?php wp_loginout(); ?></span></span>
    ';
    return $creds;
    }

    and just after the last " /span " I need to add this:
    <?php echo $wp_query->queried_object->page-info ?>

    but it's not working - it shows part of the PHP code instead of the content of the "page info" custom field.

    (This code was given to me by the guy who set up the custom field.)

    I also tried this same code in the "Footer code section" of the main Genesis settings, and again it just shows "queried_object->page-info ?>" in the bottom left corner,

    Has anyone had experience doing this?

    thanks in hope
    Tracey

    http://theleadershiptrainingworkshop.com/
    November 19, 2013 at 1:19 pm #74217
    nutsandbolts
    Member

    You could create a shortcode to output the custom field. Something like this:

    // Add shortcode for custom field
    function nabm_shortcode() {
            echo $wp_query->queried_object->page-info;
    }
    add_shortcode( 'pageinfo', 'nabm_shortcode' );

    That would enable you to put [pageinfo] in the footer function instead of the PHP code. (Note: That's untested, so it may break if my syntax is incorrect. Which is very possible.)


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 20, 2013 at 3:26 am #74343
    TraceyR
    Member

    Thanks Andrea 🙂

    Your code/syntax didn't break anything (phew), but it didn't output anything either, sadly...
    I put your Shortcode function code before my footer code (of course), and then amended the end of the footer code :

    <span style="font-size:10px;">Website by: <span style="color: #e3e3e3;">The Simple Web Company</span> • <span style="color: #e3e3e3;"><?php wp_loginout(); ?></span></span>
    <br />[pageinfo]
    ';
    return $creds;
    }

    But it's now not showing anything on the website...

    If you have any other ideas, I'd love to hear them!

    Thanks,
    Tracey 🙂

    November 20, 2013 at 1:32 pm #74495
    nutsandbolts
    Member

    Try this one and see if it outputs anything. Still trying to figure out exactly what the original PHP is calling so it may not work, either.

    // Add shortcode for custom field
    function nabm_shortcode() {
            return $wp_query->queried_object->page-info;
    }
    add_shortcode( 'pageinfo', 'nabm_shortcode' );

    Edited to add: What exactly is the custom field supposed to output?


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 21, 2013 at 4:09 am #74684
    TraceyR
    Member

    Hi Andrea,

    ah, thanks!! - it is now showing something - although not quite what I expected 🙂 It's just showing a "0" ...

    The guy whose site it is (a friend), has an SEO expert who has set up a custom field to show keywords (yes, I know this isn't good practice at ALL - but it's not my website & my business!! I did try to convince him otherwise. Anyhow....)

    The thing is, there are 4 custom fields per page, 3 set by various plugins (e.g. Sexybookmarks for social media sharing) but the 0 value being shown doesn't bear any relation to any of them - if I change the values, it still shows 0 - so it's almost like it's a binary value...

    I'm going to get the SEO person to double-check that the statement "return $wp_query->queried_object->page-info;" does actually do what he intends, as with your help we have something showing...

    Thank you kindly!!!
    Tracey

    November 21, 2013 at 5:40 pm #74809
    nutsandbolts
    Member

    If you show him what we're trying to do, he might be able to help you tweak the function for the shortcode. It's hard to know exactly how to word it without seeing how the custom field is set up.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ 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

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