Forum Replies Created
-
AuthorPosts
-
jonburrMember
Got it… it was easier than I feared.
In front-page.php, change line 24add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
to
add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_sidebar_content_sidebar’ );jonburrMemberThanks for replying to this, Brad -
The challenge is how to make an archive page the canonical link when an entire post is featured at the top of it, to avoid duplicate content, and aggregate the rank of the 2 pages.
I wrote a post about it, but I've heard that I don't need a plugin to write a post-specific rel=canonical tag.
I tested the scripts field...
First tried putting random text in there, and got the "sure you want to do this?" error...
but when I put in a properly formatted rel=canonical link, it showed up, in the head...
So it does work for that purpose.
It's still necessary to disable the rel=canonical written by Yoast, by default
(see the same article)It'll work.
June 10, 2014 at 8:46 pm in reply to: Adding backstretch to full-width header in Magazine Pro #109314jonburrMemberAh - good eyes!
That got in there from some back-and-forth on this on a Google+ thread... (took bad advice)I have (what I think is) correct code now... but when I take the wrap to 100%, the image huddles left and doesn't stretch.
June 10, 2014 at 3:27 pm in reply to: Adding backstretch to full-width header in Magazine Pro #108826jonburrMemberI didn't modify that - I lifted it from my copy of Agency Pro.
Not being able to write php, I need to borrow code... and that's where I got that.How should it read?
June 10, 2014 at 2:48 pm in reply to: Adding backstretch to full-width header in Magazine Pro #108818jonburrMemberHk Brad, thanks for having a look at this...
Yes, the javascript files are in the js folder for the Magazine Pro theme.
Other than adding them and the code above, I haven't modified the theme files.
Yes, your suggested code to call the header image is in functions.php.
Here's the entire file in its current state:
<?php //* Start the engine include_once( get_template_directory() . '/lib/init.php' ); //* Set Localization (do not remove) load_child_theme_textdomain( 'magazine', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'magazine' ) ); //* Child theme (do not remove) define( 'CHILD_THEME_NAME', __( 'Magazine Pro Theme', 'magazine' ) ); define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/magazine/' ); define( 'CHILD_THEME_VERSION', '3.0.1' ); //* Enqueue Google Fonts and JS script add_action( 'wp_enqueue_scripts', 'magazine_enqueue_scripts' ); function magazine_enqueue_scripts() { wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Roboto:300,400|Raleway:400,500,900', array(), CHILD_THEME_VERSION ); wp_enqueue_script( 'magazine-entry-date', get_bloginfo( 'stylesheet_directory' ) . '/js/entry-date.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'magazine-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); } //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); //* Remove the header right widget area unregister_sidebar( 'header-right' ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Add new image sizes add_image_size( 'home-middle', 360, 200, true ); add_image_size( 'home-top', 750, 420, true ); add_image_size( 'sidebar-thumbnail', 100, 100, true ); add_image_size( 'left-sidebar-thumbnail', 60, 60, true ); //* Add support for additional color styles add_theme_support( 'genesis-style-selector', array( 'magazine-pro-blue' => __( 'Magazine Pro Blue', 'magazine' ), 'magazine-pro-green' => __( 'Magazine Pro Green', 'magazine' ), 'magazine-pro-orange' => __( 'Magazine Pro Orange', 'magazine' ), ) ); //* Add support for custom header add_theme_support( 'custom-header', array( 'default-text-color' => '000000', 'header-selector' => '.site-title a', 'header-text' => false, 'height' => 379, 'width' => 1260, ) ); //* Reposition the primary navigation menu add_action( 'genesis_after_header', 'genesis_do_nav' ); //* Add primary-nav class if primary navigation is used add_filter( 'body_class', 'backcountry_no_nav_class' ); function backcountry_no_nav_class( $classes ) { $menu_locations = get_theme_mod( 'nav_menu_locations' ); if ( ! empty( $menu_locations['primary'] ) ) { $classes[] = 'primary-nav'; } return $classes; } //* Add Post categories above Post title add_action ( 'genesis_entry_header', 'sk_show_category_name', 9 ); function sk_show_category_name() { if ( ! ( is_singular('post') || is_archive() || is_search() || is_page_template('page_blog.php' ) || is_home() ) ) return; echo do_shortcode('[post_categories before="CATEGORY: "]'); } //* Show only Post tags in entry meta for single Posts add_filter( 'genesis_post_meta', 'sk_post_meta_filter' ); function sk_post_meta_filter($post_meta) { if ( is_singular('post') ) : $post_meta = '[post_tags]'; else : endif; return $post_meta; } //* Customize search form input box text add_filter( 'genesis_search_text', 'magazine_search_text' ); function magazine_search_text( $text ) { return esc_attr( __( 'Search the site ...', 'magazine' ) ); } //* Modify the size of the Gravatar in the author box add_filter( 'genesis_author_box_gravatar_size', 'magazine_author_box_gravatar' ); function magazine_author_box_gravatar( $size ) { return 140; } //* Modify the size of the Gravatar in the entry comments add_filter( 'genesis_comment_list_args', 'magazine_comments_gravatar' ); function magazine_comments_gravatar( $args ) { $args['avatar_size'] = 100; return $args; } //* Remove entry meta in entry footer add_action( 'genesis_before_entry', 'magazine_remove_entry_meta' ); function magazine_remove_entry_meta() { //* Remove if not single post if ( ! is_single() ) { remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); } } //* Hooks after-entry widget area to single posts add_action( 'genesis_entry_footer', 'magazine_after_entry_widget' ); function magazine_after_entry_widget() { if ( ! is_singular( 'post' ) ) return; genesis_widget_area( 'after-entry', array( 'before' => '<div class="after-entry widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); } //* Remove comment form allowed tags add_filter( 'comment_form_defaults', 'magazine_remove_comment_form_allowed_tags' ); function magazine_remove_comment_form_allowed_tags( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } //* Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 3 ); //* Register widget areas genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'magazine' ), 'description' => __( 'This is the top section of the homepage.', 'magazine' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle', 'name' => __( 'Home - Middle', 'magazine' ), 'description' => __( 'This is the middle section of the homepage.', 'magazine' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'magazine' ), 'description' => __( 'This is the bottom section of the homepage.', 'magazine' ), ) ); genesis_register_sidebar( array( 'id' => 'after-entry', 'name' => __( 'After Entry', 'magazine' ), 'description' => __( 'This is the after entry section.', 'magazine' ), ) ); //* Enqueue Backstretch script and prepare images for loading add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' ); function agency_enqueue_backstretch_scripts() { //* Load scripts only if custom background is being used if ( ! get_background_image() ) return; wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' ); wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_background_image() ) ) ); } //* Add support for custom background add_theme_support( 'custom-background', array( 'wp-head-callback' => 'agency_background_callback' ) ); //* Add custom background callback for background color function agency_background_callback() { if ( ! get_background_color() ) return; printf( '<style>body { background-color: #%s !important; }</style>' . "\n", get_background_color() ); }
jonburrMemberSorry for overposting. I got frustrated.
I have WP SuperCache installed, and although it was deactivated, its static pages were still in its cache and that's why I was seeing my new background overwritten. I had to reactivate it, and use its controls in /Settings to delete the cached pages it had created.
My beef about Custom Backgrounds, that they don't accommodate tiled images, is valid.
but, I found out that the workaround is this:If there's an image in Custom Backgrounds, delete it! and set the background image in the body selector as a background-image property in the css (near line 147).
Background-repeat: repeat-y;
needs to be set as well.jonburrMemberThis is weird and unwelcome behavior...
When I upload a full-size version of the background, it appears... but, instead of being able to serve a small file and tile it, Agency Pro seems to insist on a full-size background - assuming that any file brought into the "customizer" is intended to be full-page.
Is this Agency Pro doing this, Genesis, or Parker? What happened to the Custom Background feature?
The coding somewhere doesn't allow for the possibility of a tile.
Is this a good idea, Studiopress - when page load times are SEO criteria in a competitive environment? You're insisting that I add several hundred k to my data load and defeat traditional web functionality in the process? You should at least include an option to disable the javascript. Why is javascript pulling from a cache even when the image is deleted? Where is the cache and how can I get rid of it?
I tried deleting my custom background and adding it from css... which works in Chrome, but in Safari and Firefox, Agency Pro digs the initial image out of a cache somewhere and plasters it over my background - even after I deleted it. This is after emptying the caches on the browser. How can I defeat this?
I enjoyed coding in Agency, but Agency Pro is getting too cool for school and creating headaches for designers like myself who are not expert at javascript forensic analysis. If you're going to add functionality like this, which for many applications is admittedly cool, you should include a way to make it optional.
The microdata markup and HTML5 features are great - but you shoot yourself in the foot requiring large background images. Load times count.
jonburrMemberI've uploaded a background image.
I set it to tile vertically.
Its size is 1500x72pxThis is what I see in the Custom Background dialog:
What is going on?
"Custom Background" seems to insist on cropping my image. This used to be simple.
The site is here - Jon Burr's BlogjonburrMemberYou can also add the following to your css:
#header {
background-size: 100% auto;
}
This will resize your one header. The responsive header plugin is good, too, but necessitates the making of 4 versions of the header.
-
AuthorPosts