-
Search Results
-
Hi!
I am getting an error on my site and I don't know what I need to change to fix it! Can anyone help?
I double checked and the code on the file is the exact same as the code on a copy of Genesis I just re-downloaded from Studiopress.http://www.keylimedigitaldesigns.com
Parse error: syntax error, unexpected end of file in /home/kenjoh18/keylimedigitaldesigns.com/wp-content/themes/genesis/lib/structure/post.php on line 819
Here is the code:
<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Entry
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*//**
* Restore all default post loop output by re-hooking all default functions.
*
* Useful in the event that you need to unhook something in a particular context, but don't want to restore it for all
* subsequent loop instances.
*
* Callsgenesis_reset_loops
action after everything has been re-hooked.
*
* @since 1.5.0
*
* @global array $_genesis_loop_args Associative array for grid loop configuration
*/function genesis_reset_loops() {
// HTML5 Hooks.
add_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_header', 'genesis_post_info', 12 );add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
add_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
add_action( 'genesis_entry_footer', 'genesis_post_meta' );add_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
add_action( 'genesis_after_entry', 'genesis_adjacent_entry_nav' );
add_action( 'genesis_after_entry', 'genesis_get_comments_template' );// Pre-HTML5 hooks.
add_action( 'genesis_before_post_title', 'genesis_do_post_format_image' );
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_post_content', 'genesis_do_post_image' );
add_action( 'genesis_post_content', 'genesis_do_post_content' );
add_action( 'genesis_post_content', 'genesis_do_post_permalink' );
add_action( 'genesis_post_content', 'genesis_do_post_content_nav' );
add_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
add_action( 'genesis_after_post', 'genesis_do_author_box_single' );// Other.
add_action( 'genesis_loop_else', 'genesis_do_noposts' );
add_action( 'genesis_after_endwhile', 'genesis_posts_nav' );// Reset loop args.
global $_genesis_loop_args;
$_genesis_loop_args = array();do_action( 'genesis_reset_loops' );
}
add_filter( 'post_class', 'genesis_entry_post_class' );
/**
* Addentry
post class, removehentry
post class if HTML5.
*
* @since 1.9.0
*
* @param array $classes Existing post classes.
* @return array Amended post classes. Not modified if in WP admin, or doing Ajax request.
*/
function genesis_entry_post_class( $classes ) {if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
return $classes;
}// Add "entry" to the post class array.
$classes[] = 'entry';// Remove "hentry" from post class array, if HTML5.
if ( genesis_html5() )
$classes = array_diff( $classes, array( 'hentry' ) );return $classes;
}
add_filter( 'post_class', 'genesis_custom_post_class', 15 );
/**
* Add a custom post class, saved as a custom field.
*
* @since 1.4.0
*
* @param array $classes Existing post classes.
* @return array Amended post classes. Not modified if in WP admin.
*/
function genesis_custom_post_class( array $classes ) {if ( is_admin() ) {
return $classes;
}$new_class = genesis_get_custom_field( '_genesis_custom_post_class' );
if ( $new_class )
$classes[] = esc_attr( $new_class );return $classes;
}
add_filter( 'post_class', 'genesis_featured_image_post_class' );
/**
* Featured Image Post Class
*
* @since 2.2.0
*
* @param array $classes Existing post classes.
* @return array Amended post classes. Not modified if in WP admin.
*/
function genesis_featured_image_post_class( $classes ) {if ( is_admin() ) {
return $classes;
}$image = genesis_get_image();
if ( $image && ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) && ! in_array( 'has-post-thumbnail', $classes ) ) {
$classes[] = 'has-post-thumbnail';
}return $classes;
}
add_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
add_action( 'genesis_before_post_title', 'genesis_do_post_format_image' );
/**
* Add a post format icon.
*
* Adds an image, corresponding to the post format, before the post title.
*
* @since 1.4.0
*
* @return null Return early ifpost-formats
orgenesis-post-format-images
are not supported.
*/
function genesis_do_post_format_image() {// Do nothing if post formats aren't supported.
if ( ! current_theme_supports( 'post-formats' ) || ! current_theme_supports( 'genesis-post-format-images' ) )
return;// Get post format.
$post_format = get_post_format();// If post format is set, look for post format image.
if ( $post_format && file_exists( sprintf( '%s/images/post-formats/%s.png', CHILD_DIR, $post_format ) ) )
printf( '', get_permalink(), sprintf( '%s/images/post-formats/%s.png', CHILD_URL, $post_format ), $post_format );// Else, look for the default post format image.
elseif ( file_exists( sprintf( '%s/images/post-formats/default.png', CHILD_DIR ) ) )
printf( '', get_permalink(), CHILD_URL, 'post' );}
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
/**
* Echo the opening structural markup for the entry header.
*
* @since 2.0.0
*/
function genesis_entry_header_markup_open() {
printf( '<header %s>', genesis_attr( 'entry-header' ) );
}add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
/**
* Echo the closing structural markup for the entry header.
*
* @since 2.0.0
*/
function genesis_entry_header_markup_close() {
echo '</header>';
}add_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_post_title', 'genesis_do_post_title' );
/**
* Echo the title of a post.
*
* Thegenesis_post_title_text
filter is applied on the text of the title, while thegenesis_post_title_output
* filter is applied on the echoed markup.
*
* @since 1.1.0
*
* @return null Return early if the length of the title string is zero.
*/
function genesis_do_post_title() {$title = apply_filters( 'genesis_post_title_text', get_the_title() );
if ( 0 === mb_strlen( $title ) )
return;// Link it, if necessary.
if ( ! is_singular() && apply_filters( 'genesis_link_post_title', true ) ){
$title = sprintf( '%s', get_permalink(), $title );
}// Wrap in H1 on singular pages.
$wrap = is_singular() ? 'h1' : 'h2';// Also, if HTML5 with semantic headings, wrap in H1.
$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;/**
* Entry title wrapping element
*
* The wrapping element for the entry title.
*
* @since 2.2.3
*
* @param string $wrap The wrapping element (h1, h2, p, etc.).
*/
$wrap = apply_filters( 'genesis_entry_title_wrap', $wrap );// Build the output.
$output = genesis_markup( array(
'open' => "<{$wrap} %s>",
'close' => "</{$wrap}>",
'content' => $title,
'context' => 'entry-title',
'params' => array(
'wrap' => $wrap,
),
'echo' => false,
) );echo apply_filters( 'genesis_post_title_output', "$output \n", $wrap, $title );
}
add_filter( 'genesis_post_info', 'do_shortcode', 20 );
add_action( 'genesis_entry_header', 'genesis_post_info', 12 );
add_action( 'genesis_before_post_content', 'genesis_post_info' );
/**
* Echo the post info (byline) under the post title.
*
* By default, only does post info on posts.
*
* The post info makes use of several shortcodes by default, and the whole output
* is filtered viagenesis_post_info
before echoing.
*
* @since 0.2.3
*
* @return null Return early if post type lacks support forgenesis-entry-meta-before-content
.
*/
function genesis_post_info() {if ( ! post_type_supports( get_post_type(), 'genesis-entry-meta-before-content' ) ) {
return;
}$filtered = apply_filters( 'genesis_post_info', '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]' );
if ( false == trim( $filtered ) ) {
return;
}genesis_markup( array(
'open' => '<p %s>',
'close' => '</p>',
'content' => $filtered,
'context' => 'entry-meta-before-content',
) );add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_post_content', 'genesis_do_post_image' );
/**
* Echo the post image on archive pages.
*
* If this an archive page and the option is set to show thumbnail, then it gets the image size as per the theme
* setting, wraps it in the post permalink and echoes it.
*
* @since 1.1.0
*/
function genesis_do_post_image() {if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) {
$img = genesis_get_image( array(
'format' => 'html',
'size' => genesis_get_option( 'image_size' ),
'context' => 'archive',
'attr' => genesis_parse_attr( 'entry-image', array ( 'alt' => get_the_title() ) ),
) );if ( ! empty( $img ) ) {
genesis_markup( array(
'open' => '',
'close' => '',
'content' => wp_make_content_images_responsive( $img ),
'context' => 'entry-image-link'
));}
}
}
add_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_post_content', 'genesis_do_post_content' );
/**
* Echo the post content.
*
* On single posts or pages it echoes the full content, and optionally the trackback string if enabled. On single pages,
* also adds the edit link after the content.
*
* Elsewhere it displays either the excerpt, limited content, or full content.
*
* Applies thegenesis_edit_post_link
filter.
*
* @since 1.1.0
*/
function genesis_do_post_content() {if ( is_singular() ) {
the_content();if ( is_single() && 'open' === get_option( 'default_ping_status' ) && post_type_supports( get_post_type(), 'trackbacks' ) ) {
echo '<!--';
trackback_rdf();
echo '-->' . "\n";
}if ( is_page() && apply_filters( 'genesis_edit_post_link', true ) )
edit_post_link( __( '(Edit)', 'genesis' ), '', '' );
}
elseif ( 'excerpts' === genesis_get_option( 'content_archive' ) ) {
the_excerpt();
}
else {
if ( genesis_get_option( 'content_archive_limit' ) )
the_content_limit( (int) genesis_get_option( 'content_archive_limit' ), genesis_a11y_more_link( __( '[Read more...]', 'genesis' ) ) );
else
the_content( genesis_a11y_more_link( __( '[Read more...]', 'genesis' ) ) );
}}
add_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
add_action( 'genesis_post_content', 'genesis_do_post_content_nav' );
/**
* Display page links for paginated posts (i.e. includes the <!--nextpage--> Quicktag one or more times).
*
* @since 2.0.0
*/
function genesis_do_post_content_nav() {wp_link_pages( array(
'before' => genesis_markup( array(
'open' => '<div %s>',
'context' => 'entry-pagination',
'echo' => false,
) ) . __( 'Pages:', 'genesis' ),
'after' => genesis_markup( array(
'close' => '</div>',
'context' => 'entry-pagination',
'echo' => false,
) ),
'link_before' => genesis_a11y( 'screen-reader-text' ) ? '<span class="screen-reader-text">' . __( 'Page ', 'genesis' ) . '</span>' : '',
) );}
add_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
add_action( 'genesis_post_content', 'genesis_do_post_permalink' );
/**
* Show permalink if no title.
*
* If the entry has no title, this is a way to display a link to the full post.
*
* Applies thegenesis_post_permalink
filter.
*
* @since 2.0.0
*/
function genesis_do_post_permalink() {// Don't show on singular views, or if the entry has a title.
if ( is_singular() || get_the_title() )
return;$permalink = get_permalink();
echo apply_filters( 'genesis_post_permalink', sprintf( '<p class="entry-permalink">%s</p>', esc_url( $permalink ), esc_html( $permalink ) ) );
}
add_action( 'genesis_loop_else', 'genesis_do_noposts' );
/**
* Echo filterable content when there are no posts to show.
*
* The applied filter isgenesis_noposts_text
.
*
* @since 1.1.0
*/
function genesis_do_noposts() {printf( '<div class="entry"><p>%s</p></div>', apply_filters( 'genesis_noposts_text', __( 'Sorry, no content matched your criteria.', 'genesis' ) ) );
}
add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
/**
* Echo the opening structural markup for the entry footer.
*
* @since 2.0.0
*/
function genesis_entry_footer_markup_open() {if ( post_type_supports( get_post_type(), 'genesis-entry-meta-after-content' ) ) {
printf( '<footer %s>', genesis_attr( 'entry-footer' ) );
}}
add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
/**
* Echo the closing structural markup for the entry footer.
*
* @since 2.0.0
*/
function genesis_entry_footer_markup_close() {if ( post_type_supports( get_post_type(), 'genesis-entry-meta-after-content' ) ) {
echo '</footer>';
}}
add_filter( 'genesis_post_meta', 'do_shortcode', 20 );
add_action( 'genesis_entry_footer', 'genesis_post_meta' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
/**
* Echo the post meta after the post content.
*
* By default, only does post meta on posts.
*
* The post info makes use of a couple of shortcodes by default, and the whole output is filtered via
*genesis_post_meta
before echoing.
*
* @since 0.2.3
*
* @return null Return early if post type lacks support forgenesis-entry-meta-after-content
.
*/
function genesis_post_meta() {if ( ! post_type_supports( get_post_type(), 'genesis-entry-meta-after-content' ) ) {
return;
}$filtered = apply_filters( 'genesis_post_meta', '[post_categories] [post_tags]' );
if ( false == trim( $filtered ) ) {
return;
}$output = genesis_markup( array(
'open' => '<p %s>',
'close' => '</p>',
'content' => $filtered,
'context' => 'entry-meta-after-content',
) );}
add_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
add_action( 'genesis_after_post', 'genesis_do_author_box_single' );
/**
* Conditionally add the author box after single posts or pages.
*
* @since 1.0.0
*
* @return null Return early if not a single post or page, or post type does not supportauthor
.
*/
function genesis_do_author_box_single() {if ( ! is_single() || ! post_type_supports( get_post_type(), 'author' ) )
return;if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta( 'ID' ) ) )
genesis_author_box( 'single' );}
/**
* Echo the the author box and its contents.
*
* The title is filterable viagenesis_author_box_title
, and the gravatar size is filterable via
*genesis_author_box_gravatar_size
.
*
* The final output is filterable viagenesis_author_box
, which passes many variables through.
*
* @since 1.3.0
*
* @global WP_User $authordata Author (user) object.
*
* @param string $context Optional. Allows different author box markup for different contexts, specifically 'single'.
* Default is empty string.
* @param bool $echo Optional. If true, the author box will echo. If false, it will be returned.
* @return string HTML for author box if$echo
param is falsy.
*/
function genesis_author_box( $context = '', $echo = true ) {global $authordata;
$authordata = is_object( $authordata ) ? $authordata : get_userdata( get_query_var( 'author' ) );
$gravatar_size = apply_filters( 'genesis_author_box_gravatar_size', 70, $context );
$gravatar = get_avatar( get_the_author_meta( 'email' ), $gravatar_size );
$description = wpautop( get_the_author_meta( 'description' ) );// The author box markup, contextual.
if ( genesis_html5() ) {$title = __( 'About', 'genesis' ) . ' <span itemprop="name">' . get_the_author() . '</span>';
/**
* Author box title filter.
*
* Allows you to filter the title of the author box. $context passed as second parameter to allow for contextual filtering.
*
* @since unknown
*
* @param string $title Assembled Title.
* @param string $context Context.
*/
$title = apply_filters( 'genesis_author_box_title', $title, $context );if ( 'single' === $context && ! genesis_get_seo_option( 'semantic_headings' ) ) {
$heading_element = 'h4';
} elseif ( genesis_a11y( 'headings' ) || get_the_author_meta( 'headline', (int) get_query_var( 'author' ) ) ) {
$heading_element = 'h4';
} else {
$heading_element = 'h1';
}$pattern = sprintf( '<section %s>', genesis_attr( 'author-box' ) );
$pattern .= '%s<' . $heading_element . ' class="author-box-title">%s</' . $heading_element . '>';
$pattern .= '<div class="author-box-content" itemprop="description">%s</div>';
$pattern .= '</section>';} else {
$title = apply_filters( 'genesis_author_box_title', sprintf( '%s %s', __( 'About', 'genesis' ), get_the_author() ), $context );
if ( 'single' === $context || get_the_author_meta( 'headline', (int) get_query_var( 'author' ) ) ) {
$pattern = '<div class="author-box"><div>%s %s<br />%s</div></div>';
} else {
$pattern = '<div class="author-box">%s<h1>%s</h1><div>%s</div></div>';
}}
$output = sprintf( $pattern, $gravatar, $title, $description );
/**
* Author box output filter.
*
* Allows you to filter the full output of the author box.
*
* @since unknown
*
* @param string $output Assembled output.
* @param string $context Context.
* @param string $pattern (s)printf pattern.
* @param string $context Gravatar.
* @param string $context Title.
* @param string $context Description.
*/
$output = apply_filters( 'genesis_author_box', $output, $context, $pattern, $gravatar, $title, $description );if ( $echo )
echo $output;
else
return $output;}
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
/**
* Display after-entry widget area on the genesis_after_entry action hook.
*
* @since 2.1.0
*/
function genesis_after_entry_widget_area() {if ( ! is_singular() || ! post_type_supports( get_post_type(), 'genesis-after-entry-widget-area' ) ) {
return;
}genesis_widget_area( 'after-entry', array(
'before' => '<div class="after-entry widget-area">',
'after' => '</div>',
) );}
add_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
/**
* Conditionally echo archive pagination in a format dependent on chosen setting.
*
* This is shown at the end of archives to get to another page of entries.
*
* @since 0.2.3
*/
function genesis_posts_nav() {if ( 'numeric' === genesis_get_option( 'posts_nav' ) )
genesis_numeric_posts_nav();
else
genesis_prev_next_posts_nav();}
/**
* Echo archive pagination in Previous Posts / Next Posts format.
*
* Appliesgenesis_prev_link_text
andgenesis_next_link_text
filters.
*
* @since 0.2.2
*/
function genesis_prev_next_posts_nav() {$prev_link = get_previous_posts_link( apply_filters( 'genesis_prev_link_text', '« ' . __( 'Previous Page', 'genesis' ) ) );
$next_link = get_next_posts_link( apply_filters( 'genesis_next_link_text', __( 'Next Page', 'genesis' ) . ' »' ) );if ( $prev_link || $next_link ) {
$pagination = $prev_link ? sprintf( '<div class="pagination-previous alignleft">%s</div>', $prev_link ) : '';
$pagination .= $next_link ? sprintf( '<div class="pagination-next alignright">%s</div>', $next_link ) : '';genesis_markup( array(
'open' => '<div %s>',
'close' => '</div>',
'content' => $pagination,
'context' => 'archive-pagination',
) );}
}
/**
* Echo archive pagination in page numbers format.
*
* Applies thegenesis_prev_link_text
andgenesis_next_link_text
filters.
*
* The links, if needed, are ordered as:
*
* * previous page arrow,
* * first page,
* * up to two pages before current page,
* * current page,
* * up to two pages after the current page,
* * last page,
* * next page arrow.
*
* @since 0.2.3
*
* @global WP_Query $wp_query Query object.
*
* @return null Return early if on a single post or page, or only one page exists.
*/
function genesis_numeric_posts_nav() {if( is_singular() )
return;global $wp_query;
// Stop execution if there's only one page.
if( $wp_query->max_num_pages <= 1 )
return;$paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;
$max = intval( $wp_query->max_num_pages );// Add current page to the array.
if ( $paged >= 1 )
$links[] = $paged;// Add the pages around the current page to the array.
if ( $paged >= 3 ) {
$links[] = $paged - 1;
$links[] = $paged - 2;
}if ( ( $paged + 2 ) <= $max ) {
$links[] = $paged + 2;
$links[] = $paged + 1;
}genesis_markup( array(
'open' => '<div %s>',
'context' => 'archive-pagination',
) );$before_number = genesis_a11y( 'screen-reader-text' ) ? '<span class="screen-reader-text">' . __( 'Page ', 'genesis' ) . '</span>' : '';
echo '
- ';
// Previous Post Link.
if ( get_previous_posts_link() )
printf( '<li class="pagination-previous">%s' . "\n", get_previous_posts_link( apply_filters( 'genesis_prev_link_text', '« ' . __( 'Previous Page', 'genesis' ) ) ) );// Link to first page, plus ellipses if necessary.
if ( ! in_array( 1, $links ) ) {$class = 1 == $paged ? ' class="active"' : '';
printf( '<li%s>%s' . "\n", $class, esc_url( get_pagenum_link( 1 ) ), $before_number . '1' );
if ( ! in_array( 2, $links ) ) {
echo '<li class="pagination-omission">…' . "\n";
}}
// Link to current page, plus 2 pages in either direction if necessary.
sort( $links );
foreach ( (array) $links as $link ) {
$class = $paged == $link ? ' class="active" aria-label="' . __( 'Current page', 'genesis' ) . '"' : '';
printf( '<li%s>%s' . "\n", $class, esc_url( get_pagenum_link( $link ) ), $before_number . $link );
}// Link to last page, plus ellipses if necessary.
if ( ! in_array( $max, $links ) ) {if ( ! in_array( $max - 1, $links ) )
echo '<li class="pagination-omission">…' . "\n";$class = $paged == $max ? ' class="active"' : '';
printf( '<li%s>%s' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $before_number . $max );}
// Next Post Link.
if ( get_next_posts_link() )
printf( '<li class="pagination-next">%s' . "\n", get_next_posts_link( apply_filters( 'genesis_next_link_text', __( 'Next Page', 'genesis' ) . ' »' ) ) );echo '
';
genesis_markup( array(
'close' => '</div>',
'context' => 'archive-pagination',
) );echo "\n";
}
add_action( 'genesis_after_entry', 'genesis_adjacent_entry_nav' );
/**
* Display links to previous and next entry.
*
* @since 2.3.0
*
* @return null Return early if not singular or post type doesn't supportgenesis-adjacent-entry-nav
.
*/
function genesis_adjacent_entry_nav() {if ( ! is_singular() || ! post_type_supports( get_post_type(), 'genesis-adjacent-entry-nav' ) ) {
return;
}genesis_markup( array(
'open' => '<div %s>',
'context' => 'adjacent-entry-pagination',
) );echo '<div class="pagination-previous alignleft">';
previous_post_link( '%link', '« %title' );
echo '</div>';echo '<div class="pagination-next alignright">';
next_post_link( '%link', '%title »' );
echo '</div>';genesis_markup( array(
'close' => '</div>',
'context' => 'adjacent-entry-pagination',
) );}
/**
* Helper function to display adjacent entry navigation on single posts. Must be hooked togenesis_after_entry
at priority 10 or earlier to work properly.
*
* @since 1.5.1
*/
function genesis_prev_next_post_nav() {add_post_type_support( 'post', 'genesis-adjacent-entry-nav' );
}
I bought the Mocha child them quite some time ago but since the 1.9 release of the Genesis framework the grid loop code on home.php doesn't allow you to limit the number of posts on the home page. Frankly, I think the Mocha theme should have been updated after 1.9 release of the Genesis framework since it was this release that caused the problems with the grid loop on the home page.
I submitted a support ticket and was referred to the tutorial at http://www.billerickson.net/customize-the-wordpress-query/#example-category
But this tutorial was not helpful as I don't want to exclude a category on the home page, I just want to limit the number of posts on the home page. I was told by support that I would have to customize the Mocha theme's code or hire someone to do it for me. Which is unacceptable because the Mocha child theme should have been updated with the 1.9 release which caused the theme's code to stop working as it was originally intended. Why should have to pay someone else to fix the problems Genesis developers caused in the first place?
The website using Mocha is at the url: http://www.efashion.net.au/
I can't add any additional posts to the website until this issue is corrected, otherwise all the posts will appear on the home page. Does anyone have a fix for this issue?
Thank you.
Topic: Grid Loop Has Me Stumped
I upgraded a site that used the Education theme from Genesis 1.9.2 to 2.0.1 (also updated WP to latest version 3.6.1)
I have the grid loop at the bottom. Before the update the bottom showed two posts each with a "Read More" button. The read more was manually inserted by by client at this choice of location rather than a set limit in the Genesis Theme settings.
I had already applied the grid loop fix by wpsmith/bill erikson when I upgraded to 1.9
I have this on my home.php`add_action( 'genesis_loop', 'education_grid_loop_helper' );
function minimum_grid_loop_helper() {if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 2,
'feature_image_size' => 'featured',
'feature_image_class' => 'post-image',
'feature_content_limit' => 0,
'grid_image_size' => 'thumbnail',
'grid_image_class' => 'alignleft',
'grid_content_limit' => 200,
'more' => __( '[Read more]', 'education' ),
) );
} else {
genesis_standard_loop();
}}`
I have this in my functions.php file`/**fixing the grid loop**/
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @author Travis Smith
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
* @link http://wpsmith.net/2013/genesis/genesis-grid-loop-in-genesis-1-9/
*
* @return boolean Return true of doing the grid loop, false if not.
*/
function wps_is_doing_grid_loop() {
// Amend this conditional to pick where this grid looping occurs.
// This says to use the grid loop everywhere except single posts,
// single pages and single attachments.
return ( ! is_singular() );
}
add_action( 'pre_get_posts', 'wps_include_cat_in_grid' );
/**
* Limit Query to one Category
*
* @author Bill Erickson
* @author Travis Smith
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @link http://wpsmith.net/2013/genesis/genesis-grid-loop-in-genesis-1-9/
* @param object $query WP Query data
*
*/
function wps_include_cat_in_grid( $query ) {
if( $query->is_main_query() && $query->is_home() && wps_is_doing_grid_loop() ) {
$query->set( 'cat', '4' );
$query->set( 'posts_per_page', '2' );
}
}`
If I try and set the content limit on the grid loop it doesn't change.
If I switch to twenty twelve the more links kick in on the main page. The more links work on all the blog pages.
I am just stumped. I have turned off all the plugins as well.
The site is http://bcinstitue.comNote: I have a back up which I loaded and upgraded all plugins and wordpress but did not upgrade Genesis. All was fine.
[Resolved]Topic: 1.9 Breaking Layout (grid)
I’ve read through the various posts and URLS to “fixes” for 1.9 breaking the grid layout, but I’m not a WordPress developer and can’t seem to make sense of what I’m seeing. I’ve done everything in this reference http://wpsmith.net/2013/genesis/genesis-grid-loop-in-genesis-1-9/ but I still can’t get my blog page to appear in the grid layout that it used to, in fact nothing appears when following the instructions in this post. Any more feedback for a non-coder would be appreciated.
Topic: Featured Grid Loop
Since 1.9 kills the old grid loop, I need help figuring out how to create a loop that includes the "featured" post function. The loop that I am currently using is the "old" genesis_grid_loop. The array lets you create a "features" which ill include all the copy/content while all the other post in the loop only show their excerpt.
I can create a custom loop using 'have_posts() -> the_posts()', but how do I designate the first post in the loop to display all of its content while all the others display the excerpt?
I tried this grid loop from Bill, but when I updated to 1.9.1, it broke also. I had to revert back to 1.8.
Please Advise
Alan Smith
Media317
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.