• 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

Why doesn't the Post Info code snippet not work?

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 › Why doesn't the Post Info code snippet not work?

This topic is: resolved

Tagged: .post-info, code snippet, Function.php

  • This topic has 7 replies, 2 voices, and was last updated 12 years ago by Carla the Moose.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • May 12, 2013 at 8:42 pm #40608
    Carla the Moose
    Member

    I deleted the Simple Edits plugin and added this code from the Code Snippets page to my functions.php file:

    `/** Customize the post info function */
    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    if ( !is_page() ) {
    $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
    return $post_info;
    }}`

    Before I made any changes, I uploaded it and refreshed my website. But I got a white page. I thought you can simply paste the code snippets into the functions file without any problems. But this is the second time I've encountered a problem.

    Any suggestions? My website isn't public right now. Can this be tested without having access to my website? I'm using the eleven40 theme.

    Thank you!

    May 12, 2013 at 8:53 pm #40611
    Carla the Moose
    Member

    I wanted to add:

    I'm using the Simple Hooks plugin, but I intend to delete that one, too, once I get everything working in my functions file.

    Thanks!!

    May 12, 2013 at 9:49 pm #40614
    Bill Murray
    Member

    Generally speaking, you can paste code snippets, provided you do it correctly. The code snippets are pretty reliable; if there were an error, I'd bet that it would be promptly fixed.

    If you're not familiar with PHP, even a small typo can break your site. So you may find it safer to stick to Simple Edits.

    You also said you're using Simple Hooks. Did you put the code in your child theme functions.php? Or in Simple Hooks?

    On a quick look, the code itself seems fine. You'd paste the code after the starting tag. Normally, at the end of the file works well. Don't paste it in the middle of an existing block of code.

    If you're still having trouble, you can get your site back up by replacing your broken functions.php with a known good one. Then, to resolve your question, you can paste your functions.php to a Pastebin and paste the link in this thread.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    May 12, 2013 at 10:05 pm #40615
    Carla the Moose
    Member

    Thanks for your feedback. Here's the Pastebin link for my function file: http://pastebin.com/5ZQ4K2Kw

    I'm using Simple Hooks to customize post info while I figure out how to get the code snippet to work. I only pasted the code into my functions file.

    I don't see anything in the function I added to my file that would cause the white page. It's easy enough restoring my website by removing the snippet, but I'm not sure why this created a problem.

    May 12, 2013 at 10:49 pm #40617
    Bill Murray
    Member

    1) You have a number of modifications in that file. Were those modifications working prior to this change? In other words, if you delete only lines 164-171 of the file, does your site function normally?

    2) I think you have to decide whether you'll use Simple Hooks or code in functions.php to modify postinfo. If you're going down the path in this thread, you'll have to remove the code in Simple Hooks and not load anything else related to postinfo. It's too hard to debug with competing sets of code trying to change the same thing. If you've tested #1, ditch the postinfo code in Simple Hooks, put the code in question back into your functions.php per the Pastebin, give it a shot, and post the results.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    May 12, 2013 at 11:06 pm #40618
    Carla the Moose
    Member

    I showed you my functions file with the code snippet included. I removed that snippet as soon as I realized it was causing an error. So my actual file doesn't include that section of post-info code.

    Nothing is competing with the Simple Hooks plugin. Just pretend I'm not using that plugin. Sometimes when I ask for support, I'm told to use a plugin, and I always have to make it clear that my objective is to avoid them. That's the only reason I mentioned it. I've edited my post-info via the plugin, since the code snippet gave me a white screen. I never use both at the same time.

    Everything in my functions file works. The only problem was the post-info code snippet.

    May 12, 2013 at 11:16 pm #40619
    Carla the Moose
    Member

    When you mentioned I have a lot of functions in that file, it triggered a thought. So I browsed the other functions and may have found the issue. I'll post back here in a second.

    May 12, 2013 at 11:21 pm #40620
    Carla the Moose
    Member

    Ha! It worked.

    I found the same code snippet in my functions file, but specific to changing the comment link text. It used the same filter and was identical to the post-info snippet, except it only included code for the link.

    I removed that snippet, made my changes to the post-info snippet, and it worked.

    Thanks for jumping in and lending a paw. If you hadn't mentioned the other functions, I wouldn't have given any thought to reviewing them for a possible conflict.

    Much appreciated!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Why doesn't the Post Info code snippet not work?’ is closed to new replies.

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