Forum Replies Created
-
AuthorPosts
-
gswartzMember
Unfortunately this site was completed by someone else a few months ago who has moved on to another position. We're just doing some tweaks to it. I realize there could be issues with an update, but we don't have the time/money to redo this whole thing just to get it into a child theme. I do appreciate the advice though.
gswartzMemberOk I've gotten further. I had to go to the reading area and remove the Test page as the posts page. Now the content shows above the posts. However it doesn't show on the individual blog post pages. Any ideas what to change to accomplish this?
gswartzMemberThanks Tom, but after adding the code to the page-blog.php, I'm not seeing any change. Here's how my page-blog.php looks now. Also, is this supposed to put the content on both the blog index page and each individual post page? Thanks.
<?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\Templates
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*///* Template Name: Blog
//* The blog page loop logic is located in lib/structure/loops.php
add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
genesis();June 2, 2015 at 11:58 am in reply to: how to add content to blog index and post detail pages #154579gswartzMemberYes, we want both the blog index page and each individual blog article to have the News & Notes image and caption at the top of the page. Like where it currently is on the news & notes page... just with the blog content below that. Make sense? Sorry if it's confusing.
June 2, 2015 at 11:47 am in reply to: how to add content to blog index and post detail pages #154576gswartzMemberRight now the Test page is set up identically to news-notes. I don't want to be doing anything that will screw up news-notes since it's a "live" page. And the Test page already IS set up as the posts page. So, changing it to news-notes will be the same result as what you see right now on the test page.
gswartzMember@genwrock, here is the code from my functions file
//* Start the engine include_once( get_template_directory() . '/lib/init.php' ); //* Setup Theme include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' ); //* Set Localization (do not remove) load_child_theme_textdomain( 'parallax', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'parallax' ) ); //* Add Image upload to WordPress Theme Customizer add_action( 'customize_register', 'parallax_customizer' ); function parallax_customizer(){ require_once( get_stylesheet_directory() . '/lib/customize.php' ); } //* Include Section Image CSS include_once( get_stylesheet_directory() . '/lib/output.php' ); //* Child theme (do not remove) define( 'CHILD_THEME_NAME', 'Parallax Pro Theme' ); define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/parallax/' ); define( 'CHILD_THEME_VERSION', '1.2' ); //* Enqueue scripts and styles add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts_styles' ); function parallax_enqueue_scripts_styles() { wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION ); } //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' ); //* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_footer', 'genesis_do_subnav', 7 ); //* Reduce the secondary navigation menu to one level depth add_filter( 'wp_nav_menu_args', 'parallax_secondary_menu_args' ); function parallax_secondary_menu_args( $args ){ if( 'secondary' != $args['theme_location'] ) return $args; $args['depth'] = 1; return $args; } //* Unregister layout settings genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); //* Add support for additional color styles add_theme_support( 'genesis-style-selector', array( 'parallax-pro-blue' => __( 'Parallax Pro Blue', 'parallax' ), 'parallax-pro-green' => __( 'Parallax Pro Green', 'parallax' ), 'parallax-pro-orange' => __( 'Parallax Pro Orange', 'parallax' ), 'parallax-pro-pink' => __( 'Parallax Pro Pink', 'parallax' ), ) ); //* Unregister secondary sidebar unregister_sidebar( 'sidebar-alt' ); //* Add support for custom header add_theme_support( 'custom-header', array( 'width' => 152, 'height' => 77, 'header-selector' => '.site-title a', 'header-text' => false, ) ); //* Add support for structural wraps add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'footer-widgets', 'footer', ) ); //* Modify the size of the Gravatar in the author box add_filter( 'genesis_author_box_gravatar_size', 'parallax_author_box_gravatar' ); function parallax_author_box_gravatar( $size ) { return 176; } //* Modify the size of the Gravatar in the entry comments add_filter( 'genesis_comment_list_args', 'parallax_comments_gravatar' ); function parallax_comments_gravatar( $args ) { $args['avatar_size'] = 120; return $args; } //* Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 1 ); //* Add support for after entry widget add_theme_support( 'genesis-after-entry-widget-area' ); //* Relocate after entry widget remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 ); //* Register widget areas genesis_register_sidebar( array( 'id' => 'home-section-1', 'name' => __( 'Home Section 1', 'parallax' ), 'description' => __( 'This is the home section 1 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-2', 'name' => __( 'Home Section 2', 'parallax' ), 'description' => __( 'This is the home section 2 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-3', 'name' => __( 'Home Section 3', 'parallax' ), 'description' => __( 'This is the home section 3 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-4', 'name' => __( 'Home Section 4', 'parallax' ), 'description' => __( 'This is the home section 4 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-5', 'name' => __( 'Home Section 5', 'parallax' ), 'description' => __( 'This is the home section 5 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-6', 'name' => __( 'Home Section 6', 'parallax' ), 'description' => __( 'This is the home section 6 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-7', 'name' => __( 'Home Section 7', 'parallax' ), 'description' => __( 'This is the home section 7 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-8', 'name' => __( 'Home Section 8', 'parallax' ), 'description' => __( 'This is the home section 8 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-9', 'name' => __( 'Home Section 9', 'parallax' ), 'description' => __( 'This is the home section 9 section.', 'parallax' ), ) ); //* add blog header image div add_action( 'genesis_after_header', 'add_blog_header' ); function add_blog_header(){ if (is_home()){ echo '<div id="dvBlogHeader"><div class="inner"><h1>Careers</h1><p>We are always looking for talented individuals to come along for the wild ride and help us make a difference in our customers\'s lives. We work hard, but we have fun, too!</div></div>'; } } //* Add Read More Link to Excerpts function custom_excerpt_more( $more ) { return '...<a href="'.get_permalink().'">read more</a>'; } add_filter( 'excerpt_more', 'custom_excerpt_more' );
@braddalton, that's what I have set.gswartzMemberThank you but nothing has changed. Do I need to do something with enabling some type of theme support?
gswartzMemberWoops, I forgot to add the code.
add_filter(‘excerpt_more’, ‘get_read_more_link’); add_filter( ‘the_content_more_link’, ‘get_read_more_link’ ); function get_read_more_link() { return '… <a href="' . get_permalink() . '">Read More…</a>'; }
gswartzMemberSorry, somehow I got some code mixed up. Here is what I'm using...
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 ); function single_post_featured_image() { if (! is_singular( 'post' ) ) return; if ( !has_post_thumbnail() ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href="%s" title="%s" class="blog-featured-image">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
I believe this matches the 'DISPLAY FEATURED IMAGE AFTER TITLE' code from the link you provided with the only differences being the class I added to the link and also the has_post_thumbnail() return check.
However, I don't think this is causing the issue because this code would be specific to the blog single page, not the index page, right?
So, really my main issue now is only with the blog index page - trying to figure out how to get the featured image to show up in the list of blog entries. Again, if I enable the 'include featured image' setting under genesis theme settings it does show up, but it continues to show up even if I remove the featured image from the post.
gswartzMemberSorry about that. Is this what you meant?
add_action( ‘genesis_entry_header’, ‘single_post_featured_image’, 15 ); function single_post_featured_image() { if (! is_singular( ‘post’ ) ) return; if ( !has_post_thumbnail() ) return; $img = genesis_get_image( array( ‘format’ => ‘html’, ‘size’ => genesis_get_option( ‘image_size’ ), ‘attr’ => array( ‘class’ => ‘post-image’ ) ) ); printf( ‘%s‘, get_permalink(), the_title_attribute( ‘echo=0′ ), $img ); }
gswartzMemberI tweaked the code a bit to this which works on the single page.
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
function single_post_featured_image() {
if (! is_singular( 'post' ) )
return;
if ( !has_post_thumbnail() ) return;$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}The problem I have now is that I previously had "include featured image?" turned on in the genesis theme settings which made it show up on the blog index page. But, again when the featured image is removed, with this setting turned on, it still shows the old featured image. If I disable this option, then no featured image shows up. So, for the blog index page, how can I get the featured image to show up only if it's actually set?
gswartzMemberApparently I'm missing something. I used this code from the link you provided and it did show the featured image.
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
function single_post_featured_image() {
if ( ! is_singular( 'post' ) )
return;
$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}I didn't think to remove the featured image but just tried that and now the image still shows, even after being removed from the post. What do I need to change to make it only show the featured image when the featured image is set?
gswartzMemberAwesome, thank you very much!
gswartzMemberSingle posts. For example, if you go to the link I provided in the original post you'll see the featured image shows up in the blog index page. But not on the single page - http://uhpartners.hiringhook.com/2014/08/25/the-first-round-draft-pick/
gswartzMemberYes, we're using AgentPress Pro.
gswartzMemberNo, in the subject I originally said AgencyPress Pro but I mistyped. The theme we're using is AgentPress Pro. That's what I was trying to clear up in my last post.
gswartzMemberI just redownloaded it, opened functions.php and the code you show is not in there. Are we talking about the same theme? I misspoke originally, not agencypress but agentpress pro.
I do see this...
//* Add support for after entry widget
add_theme_support( 'genesis-after-entry-widget-area' );//* Relocate after entry widget
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );But it's the only after entry code I see in the functions file.
gswartzMemberInteresting. I asked the dev if she edited the functions file and she said no so I'm not sure why it wouldn't be in there. I'll redownload it and give it another try. Thanks!
gswartzMember1) No
2) NogswartzMemberLooks like changing it from is_singular('post') to is_page() allows it to work on the pages which is really what I needed. Thanks!
-
AuthorPosts