Forum Replies Created
-
AuthorPosts
-
Victor FontModerator
The comments structure in the Genesis Framework uses standard WordPress functionality to display the comments. Unfortunately, there aren't any filters in the code to make it easy to change the way dates are displayed. To change what you want requires writing a custom callback function to override what the framework provides. The first part requires changing the callback in the defaults passed to wp_list_comments(). The second part requires changing the get_comment_date() and get_comment_time() to human_time_diff( get_comment_time( 'U' ), current_time( 'timestamp' ) ) in the new custom callback. I've tested the code below with the Genesis Sample theme. You may want to tweak the display to your liking, but the hard work is done.
Add this code to your child theme's functions.php. It assumes you are using a HTML5 theme. This will not work on the older XHTML themes.
add_filter( 'genesis_comment_list_args', 'my_custom_comment_callback' ); function my_custom_comment_callback( $defaults ) { $defaults['callback'] = genesis_html5() ? 'my_html5_comment_callback' : 'genesis_comment_callback'; return $defaults; } function my_html5_comment_callback( $comment, array $args, $depth ) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <article <?php echo genesis_attr( 'comment' ); ?>> <?php do_action( 'genesis_before_comment' ); ?> <header <?php echo genesis_attr( 'comment-header' ); ?>> <p <?php echo genesis_attr( 'comment-author' ); ?>> <?php echo get_avatar( $comment, $args['avatar_size'] ); $author = get_comment_author(); $url = get_comment_author_url(); if ( ! empty( $url ) && 'http://' !== $url ) { $author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author ); } /** * Filter the "comment author says" text. * * Allows developer to filter the "comment author says" text so it can say something different, or nothing at all. * * @since unknown * * @param string $text Comment author says text. */ $comment_author_says_text = apply_filters( 'comment_author_says_text', __( 'says', 'genesis' ) ); if ( ! empty( $comment_author_says_text ) ) { $comment_author_says_text = '<span class="says">' . $comment_author_says_text . '</span>'; } printf( '<span itemprop="name">%s</span> %s', $author, $comment_author_says_text ); ?> </p> <?php /** * Allows developer to control whether to print the comment date. * * @since 2.2.0 * * @param bool $comment_date Whether to print the comment date. * @param string $post_type The current post type. */ $comment_date = apply_filters( 'genesis_show_comment_date', true, get_post_type() ); if ( $comment_date ) { printf( '<p %s>', genesis_attr( 'comment-meta' ) ); printf( '<time %s>', genesis_attr( 'comment-time' ) ); printf( '<a href="%s" %s>', esc_url( get_comment_link( $comment->comment_ID ) ), genesis_attr( 'comment-time-link' ) ); echo esc_html( human_time_diff( get_comment_time( 'U' ), current_time( 'timestamp' ) ) ); echo '</a></time></p>'; } edit_comment_link( __( '(Edit)', 'genesis' ), ' ' ); ?> </header> <div <?php echo genesis_attr( 'comment-content' ); ?>> <?php if ( ! $comment->comment_approved ) : ?> <?php /** * Filter the "comment awaiting moderation" text. * * Allows developer to filter the "comment awaiting moderation" text so it can say something different, or nothing at all. * * @since unknown * * @param string $text Comment awaiting moderation text. */ $comment_awaiting_moderation_text = apply_filters( 'genesis_comment_awaiting_moderation', __( 'Your comment is awaiting moderation.', 'genesis' ) ); ?> <p class="alert"><?php echo $comment_awaiting_moderation_text; ?></p> <?php endif; ?> <?php comment_text(); ?> </div> <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'before' => sprintf( '<div %s>', genesis_attr( 'comment-reply' ) ), 'after' => '</div>', ) ) ); ?> <?php do_action( 'genesis_after_comment' ); ?> </article> <?php // No ending </li> tag because of comment threading. }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorAll caches. Cloudflare included.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 27, 2017 at 5:15 am in reply to: Education Pro Theme- How to make 3-columns footer? #202067Victor FontModeratorThat's the only way to change the number of footer widgets in a Genesis child theme. If it's not working, then you have something else going on and you'll have to debug the situation.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorLet me refer you again to the codex. It answers your question about WordPress out of the box conditionals. https://codex.wordpress.org/Conditional_Tags.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorhttps://codex.wordpress.org/Using_Permalinks
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorJust don't place any content into the header right area. It won't render without content.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2017 at 7:39 pm in reply to: Education Pro Theme- How to make 3-columns footer? #202042Victor FontModeratorEdit functions.php at line 67. Change the 5 to 3:
add_theme_support( 'genesis-footer-widgets', 3 );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorYou need to remove the title-area markup:
add_filter('genesis_markup_title-area', '__return_null');
Then change the CSS width for .site-header .widget-area to 100%.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorUnless you created a function called is_price_page(), there's not such thing. You need to use a WordPress conditional: https://codex.wordpress.org/Conditional_Tags.
Try is_page() with the page number parameter.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2017 at 1:32 pm in reply to: Executive Pro – Remove Archive Sidebar – Keep Single Post Sidebar #202024Victor FontModeratorEach page has its own layout setting. You can set the layout for the page in the page editor.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorAssuming you made the sample theme customizations to the child theme's functions.php and style.css, changing to a different theme won't have any impact on the sample theme. Each child theme has its own functions.php and style.css.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorI just upgraded this real estate site with Agency Pro. http://south-forsyth-real-estate.com/. The Agent Focused Pro or AgentPress Pro themes may also be good choices.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorOutput.php only displays the background images on the front page. If you want the background images on another page, you have to change the following conditional to include the new page:
if ( is_front_page() ) { $css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : ''; }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2017 at 11:31 am in reply to: Seeking simple shopping cart theme for "pro bono" client site #202001Victor FontModeratorYou still need WooCommerce, but you won't need Genesis Connect any longer.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorRegister the new widget areas in functions.php. Add the code to display them in your new template. Yes, you can reuse code and rename functions accordingly so there's no conflict.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2017 at 9:52 am in reply to: Aspire Pro Build in less than 4 hours with commentary #201997Victor FontModeratorGood job!
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorTry saving permalinks.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2017 at 9:31 am in reply to: How to remove top blank space – Genesis Metro Pro Theme #201995Victor FontModeratorChange the margin for .site-container-wrap at line 578 in style.css to margin: 0px auto;
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorPlease post a link to the site.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?Victor FontModeratorYou have to modify the entry meta: https://my.studiopress.com/documentation/snippets/entry-header-html5/customize-the-entry-header/
The default is that the publish date displays, so it's possble there's already code in your theme to remove it.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts