Community Forums › Forums › Archived Forums › General Discussion › How Remove Items From Landing Page – Magazine
Tagged: author info, breadcrumbs, landing page, magazine, remove, title
- This topic has 10 replies, 3 voices, and was last updated 11 years, 9 months ago by Bill Murray.
-
AuthorPosts
-
February 13, 2013 at 4:46 am #20041Eric McCartyMember
I need to remove several things from the landing page template. Using Magazine theme. Here's the landing page. http://www.blueridgeparkwaydaily.com/blog/subscribe/
I would like to remove breadcrumbs, title, and author info.
Here's the code for the page_landing.php . . .
<?php
/**
* This file adds the Landing template to the Magazine Child Theme.
*
* @author StudioPress
* @package Generate
* @subpackage Customizations
*//*
Template Name: Landing
*/// Add custom body class to the head
add_filter( 'body_class', 'magazine_add_body_class' );
function magazine_add_body_class( $classes ) {
$classes[] = 'magazine-landing';
return $classes;
}// Remove header, navigation, breadcrumbs, footer widgets, footer
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
remove_action( 'genesis_before', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
remove_action( 'genesis_after_header', 'genesis_do_breadcrumb');
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );genesis();
February 13, 2013 at 4:17 pm #20158Eric McCartyMemberTitle should say "How To Remove Items From Landing Page - Magazine
February 13, 2013 at 4:57 pm #20171Joseph LeeMemberEric, download the AGENTPRESS theme. It has a template in there for a landing page that deletes all the things you are trying to delete. Just copy the lines of code. I think they will be easy to pick out because they are practically named (as always).
February 16, 2013 at 11:33 am #20691Eric McCartyMemberThanks Joseph,
Does anyone happen to have the landing page code? I'll pay for the AgentPress theme if I have to, but since I'm not using that theme, would rather not if possible.
February 16, 2013 at 2:17 pm #20709Bill MurrayMemberThe landing page code for AgentPress is essentially identical to what you have, so it won't get you closer to your goal.
I believe your breadcrumbs aren't being removed because you have a typo in your landing page template. The correct remove_action is:
remove_action( 'genesis_after_header', 'genesis_do_breadcrumbs');
Note you are missing an 's' on breadcrumbs.
From memory, this ought to remove the title:
remove_action('genesis_post_title', 'genesis_do_post_title');
The author info doesn't appear on the Magazine landing page template, so it's already been removed.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
February 16, 2013 at 2:41 pm #20715Eric McCartyMemberThanks Bill. The title remove worked.
I had tried the "s" on breadcrumbs and it didn't solve it. Copied and pasted your code and tried again and it is still showing up.
The "Author Info" I mentioned is actually "About Author" down at the bottom. Shows gravatar, name, and user description.
February 16, 2013 at 5:27 pm #20728Bill MurrayMemberFor the breadcrumbs, the code I gave you is correct. However, the remove_action must be targeting the spot (the hook) where the action is taking place. The hook I gave you is based on the default Magazine theme, which you can see works based on the landing page link in my previous post. Did you reposition breadcrumbs by something in your functions.php? or by use of another plugin? If so, you need to change the hook in the remove action to refer to whereever breadcrumbs are presently located. Look for anything in your functions.php that relates to breadcrumbs and if you can't figure out the name of the hook, post the relevant code here.
For the author box, sorry. I didn't scroll down the whole page. That box is triggered by your author settings, which are not configured to display the author box in the my demo link - hence it didn't display.
Try this to remove the author box:
remove_action( 'genesis_after_post', 'genesis_do_author_box_single' );
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
February 18, 2013 at 8:34 pm #21174Eric McCartyMemberThanks Bill!
I can't find anything in functions.php regarding breadcrumbs. Pasting the code I have below. And as far as plugins, here is what I have activated: Contact Form 7, Contact Form DB, Genesis Latest Tweets Widget, Genesis Responsive Slider, Jetpack, Simple:Press, WordPress SEO, WP Super Popup. Several more installed, but not activated.
Author box removal with your code was unsuccessful as well.
Obviously, I need to learn some php. Recommendations on resources to do this are appreciated.
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Magazine Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/magazine' );/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'magazine_add_viewport_meta_tag' );
function magazine_add_viewport_meta_tag() {
echo '';
}/** Create additional color style options */
add_theme_support( 'genesis-style-selector', array(
'magazine-blue' => 'Blue',
'magazine-green' => 'Green',
'magazine-orange' => 'Orange',
'magazine-purple' => 'Purple',
'magazine-red' => 'Red',
'magazine-teal' => 'Teal'
) );$content_width = apply_filters( 'content_width', 610, 460, 910 );
/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );///add author pic and bio
function get_author_bio ($content=''){
global $post;{
$post_author_name=get_the_author_meta("display_name");
$post_author_description=get_the_author_meta("description");
$html="\n";
$html.="By ".$post_author_name." ".$post_author_description."\n";
$html.="\n";
$html.="\n";
$html.="\n\n";$content .= $html;
}return $content;
}
add_filter('the_content', 'get_author_bio');/** Add new image sizes */
add_image_size( 'home-bottom', 280, 150, TRUE );
add_image_size( 'slider', 600, 250, TRUE );
add_image_size( 'square', 120, 120, TRUE );
add_image_size( 'tabs', 580, 250, TRUE );/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 960,
'height' => 115
) );/** Add support for custom background */
add_theme_support( 'custom-background' );/** Reposition the primary navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before', 'genesis_do_nav' );/** Add after post ad section */
add_action( 'genesis_after_post_content', 'magazine_after_post_ad', 9 );
function magazine_after_post_ad() {
if ( is_single() && is_active_sidebar( 'after-post-ad' ) ) {
echo '';
dynamic_sidebar( 'after-post-ad' );
echo '';
}
}/** Add after content ad section */
add_action( 'genesis_before_footer', 'magazine_after_content_ad' );
function magazine_after_content_ad() {
if ( is_active_sidebar( 'after-content-ad' ) ) {
echo '';
dynamic_sidebar( 'after-content-ad' );
echo '';
}
}/** 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 home top section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-left',
'name' => __( 'Home Left', 'magazine' ),
'description' => __( 'This is the home left section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-right',
'name' => __( 'Home Right', 'magazine' ),
'description' => __( 'This is the home right section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom',
'name' => __( 'Home Bottom', 'magazine' ),
'description' => __( 'This is the home bottom section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'after-post-ad',
'name' => __( 'After Post Ad', 'magazine' ),
'description' => __( 'This is the after post ad section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'after-content-ad',
'name' => __( 'After Content Ad', 'magazine' ),
'description' => __( 'This is the after content ad section.', 'magazine' ),
) );
add_filter('login_redirect', 'plugin_admin_redirect');
function plugin_admin_redirect($redirect_to, $url_redirect_to = '', $user = null) {
return '/forums';
}February 18, 2013 at 11:45 pm #21209Bill MurrayMemberSorry for just catching up on this now. It's harder than it used to be to find a thread that needs a fresh reply from one of the posters.
1) On the author box: see the line
add_filter(‘the_content’, ‘get_author_bio’);
in your functions.php? You added the author box via a filter that tacks it on the end of post/page content, so the remove action I gave you would not work, which you found out. Before playing around with actions, it's always a good idea to see how things ended up on the page in the 1st place, because if you try to remove them via a hook and that hook is not how they got there in the 1st place, the remove action won't work. Therefore, for your situation, try putting this in your landing page template:
remove_filter(‘the_content’, ‘get_author_bio’);
2) author box cont'd: I don't think the way you added the author box is part of the default Magazine theme. I think you would have been better served to add the author box by using an action, which would make removing it easier. If the suggestion above doesn't work for removal, that's the next step.
3) For the breadcrumbs, change the remove action to:
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
Post back with the results.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
February 19, 2013 at 4:46 pm #21491Eric McCartyMemberPerfect! Thank you Bill!
Your responses were detailed and easy to follow. I applied for a patent a few years ago that would enable PayPal "tips" for helpful forum posts. I took the site down and quit shoveling money into the patent app. You would have definitely received a monetary Thanks for the help.
Eric
February 19, 2013 at 4:57 pm #21494Bill MurrayMemberGlad it worked, Eric.
Smart move on stopping shoveling money into patents. I made that mistake myself. The process patents are a great way to make money - if you're a patent attorney.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.