• 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

php inside functions.php

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 › php inside functions.php

This topic is: not resolved

Tagged: functions, PHP Code, Wordpress

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago by Brad Dalton.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 10, 2014 at 9:28 am #123745
    malcomiles
    Member

    Hi guys πŸ˜€

    I wanted to display the page loading time and the sql calls at footer. WordPress have this useful php codes that does exactly that.

    <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.

    If I place this code inside my functions file, it will be rendered as plain text and it will be not executed... x_D I guess theres a security reason for it to happen, but i really wanted to display it while i were working on the child theme, i have no luck.

    ΒΏIt is possible to do it, or its my duty to create a complete footer.php file for this to work?

    Cheers πŸ˜€

    September 10, 2014 at 9:44 am #123747
    malcomiles
    Member

    let me reply to myself πŸ˜€ :

    add_filter ('genesis_footer_creds_text', 'custom_footer_creds_text');
    function custom_footer_creds_text($creds) {
    $creds = '[footer_copyright]' . get_bloginfo('name') . ' &bull; Built on the [footer_genesis_link]' . get_num_queries() . timer_stop(1);
     return  $creds;
    }
    September 10, 2014 at 1:47 pm #123809
    Brad Dalton
    Participant

    Add some text as well

    https://gist.github.com/braddalton/3bbdc111403c93811187


    Tutorials for StudioPress Themes & WooCommerce.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 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