Forum Replies Created
-
AuthorPosts
-
November 8, 2014 at 2:41 pm in reply to: Can't select a specific category in Genesis Blog page template #130944vangelisbelMember
UPDATE
I used the following code (found at http://www.wpstuffs.com/exclude-posts-category-front-page-genesis/) in functions.php and it worked!
/** Exclude certain category from posts */
add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
function be_exclude_category_from_blog( $query ) {if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '-156' );
}
}November 8, 2014 at 1:48 pm in reply to: Can't select a specific category in Genesis Blog page template #130941vangelisbelMemberIt's not 1. I know how to find Categories and Tags IDs. Anyway I'll try creating a custom page template of a category.
November 8, 2014 at 5:43 am in reply to: Can't select a specific category in Genesis Blog page template #130892vangelisbelMemberTried that as well. The ID is 119. I put that in "Exclude the following Category IDs:" textbox and nothing happens...
Maybe it's a plugin or something? Have you heard of something like this before?November 8, 2014 at 5:36 am in reply to: Can't select a specific category in Genesis Blog page template #130887vangelisbelMemberThank you genwrock for your reply!
The "Uncategorized" category (or I can name it any other name), is the one I don't want to appear on my blog.
I want the posts under the "Uncategorized" category to be hidden and show up only if someone has the specific URL to them.All the other posts I want to appear on my blog, are under the All Posts category.
When I select the All Posts category to show up, this doesn't work. Instead all categories show up including the Uncategorized one. Hope I didn't confuse you with my description!
vangelisbelMemberThanks so much! You're the best!
vangelisbelMemberOh... Finally! Thanks so much!
It was a plugin issue after all. I did had Simple Edits activated and once I deactivated it, the word "Categories" showed up!
Actually the only reason I downloaded this plugin is because I wasn't confident enough to change the following code myself into © Copyright 2013 Vangelis Photography:
//* Customize the footer
add_filter( 'genesis_footer_output', 'sixteen_nine_custom_footer' );
function sixteen_nine_custom_footer( $output ) {$output = sprintf( '<p>%s%s</p>', __( 'Powered by ', 'sixteen-nine' ), __( 'Genesis', 'sixteen-nine' ) );
return $output;}
If you help me with this customisation, I owe you a big one!!!
vangelisbelMemberNo, I don't have a CND enabled. I don't think that it's a cache thing, because I did some other functions.php customisations and all of them appeared once I reloaded the page. It's the first time that a change I do, doesn't show up..
vangelisbelMemberme too.. I also had a problem with the default layout. If I select the full-width one as the default and want the sidebar one only in some pages, it doesn't work.
I had to select the sidebar layout as the default and select in most of the pages the full-width layout as a custom choice.
Do you think there might be something wrong with my theme installation?
Should I install the original theme again and redo all the customisations?
vangelisbelMemberUnfortunately no change once again.
I have one bracket at the end of the code, right?vangelisbelMemberI have no caching plugins.
I changed the permalinks, but still no change..
I can't really understand why though...vangelisbelMemberHi again and thanks so much for trying to help!
I copied and pasted my whole fuctions.php file below and I made the post meta code bold.
Did you test the code in the same theme?
Could this be a Genesis 2 or HTML5 thing that requires a different code?<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );//* Set Localization (do not remove)
load_child_theme_textdomain( 'sixteen-nine', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'sixteen-nine' ) );//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Vangelisphotography Theme', 'vangelisphotography' ) );
define( 'CHILD_THEME_URL', 'http://www.vangelisphotography.com' );
define( 'CHILD_THEME_VERSION', '1.0' );//* Add HTML5 markup structure
add_theme_support( 'html5' );//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );//* Enqueue Playfair Display and Roboto family of Google fonts
add_action( 'wp_enqueue_scripts', 'sixteen_nine_google_fonts' );
function sixteen_nine_google_fonts() {wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Playfair+Display:300italic|Roboto:300,700|Roboto+Condensed:300,700|Roboto+Slab:300', array(), PARENT_THEME_VERSION );
}
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'sixteen_nine_enqueue_scripts' );
function sixteen_nine_enqueue_scripts() {wp_enqueue_script( 'sixteen-nine-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
//* Load scripts only if custom background is being used
if ( ! get_background_image() )
return;wp_enqueue_script( 'sixteen-nine-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'sixteen-nine-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'sixteen-nine-backstretch' ), '1.0.0' );
wp_localize_script( 'sixteen-nine-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) );}
//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Categories: "]';
return $post_meta;
}}//* Add support for custom background
add_theme_support( 'custom-background', array( 'wp-head-callback' => '__return_false' ) );//* Add support for custom header
add_theme_support( 'custom-header', array(
'admin-preview-callback' => 'sixteen_nine_admin_header_callback',
'default-text-color' => 'ffffff',
'header-selector' => '.site-header .site-avatar img',
'height' => 121,
'width' => 224,
'wp-head-callback' => 'sixteen_nine_header_callback',
) );function sixteen_nine_admin_header_callback() {
echo get_header_image() ? '' : get_avatar( get_option( 'admin_email' ), 224 );
}function sixteen_nine_header_callback() {
if ( ! get_header_textcolor() )
return;printf( '<style type="text/css">.site-title a { color: #%s; }</style>' . "\n", get_header_textcolor() );
}//* Unregister layout settings
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );//* Unregister primary/secondary navigation menus
remove_theme_support( 'genesis-menus' );//* Unregister secondary sidebar
unregister_sidebar( 'sidebar-alt' );//* Hook site avatar before site title
add_action( 'genesis_header', 'sixteen_nine_site_gravatar', 5 );
function sixteen_nine_site_gravatar() {$header_image = get_header_image() ? '' : get_avatar( get_option( 'admin_email' ), 224 );
printf( '<div class="site-avatar">%s</div>', home_url( '/' ), $header_image );
}
//* Hook after post widget after the entry content
add_action( 'genesis_after_entry', 'sixteen_nine_after_entry', 5 );
function sixteen_nine_after_entry() {if ( is_singular( 'post' ) )
genesis_widget_area( 'after-entry', array(
'before' => '<div class="after-entry" class="widget-area">',
'after' => '</div>',
) );}
//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'sixteen_nine_author_box_gravatar' );
function sixteen_nine_author_box_gravatar( $size ) {return 140;
}
//* Modify the size of the Gravatar in the entry comments
add_filter( 'genesis_comment_list_args', 'sixteen_nine_comments_gravatar' );
function sixteen_nine_comments_gravatar( $args ) {$args['avatar_size'] = 96;
return $args;
}
//* Reposition the footer
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 );
add_action( 'genesis_header', 'genesis_footer_markup_open', 11 );
add_action( 'genesis_header', 'genesis_do_footer', 12 );
add_action( 'genesis_header', 'genesis_footer_markup_close', 13 );//* Customize the footer
add_filter( 'genesis_footer_output', 'sixteen_nine_custom_footer' );
function sixteen_nine_custom_footer( $output ) {$output = sprintf( '<p>%s%s</p>', __( 'Powered by ', 'sixteen-nine' ), __( 'Genesis', 'sixteen-nine' ) );
return $output;}
// Add Read More Link to Excerpts
add_filter('excerpt_more', 'get_read_more_link');
add_filter( 'the_content_more_link', 'get_read_more_link' );
function get_read_more_link() {
return '... [View full post]';
}//***Customize The Comment Form**/
add_filter( 'comment_form_defaults', 'bourncreative_custom_comment_form' );
function bourncreative_custom_comment_form($fields) {
$fields['comment_notes_before'] = ''; //Removes Email Privacy Notice
$fields['title_reply'] = __( 'Share your Comments:', 'customtheme' ); //Changes The Form Headline
$fields['label_submit'] = __( 'Share my Comment', 'customtheme' ); //Changes The Submit Button Text
$fields['comment_notes_after'] = ''; //Removes Form Allowed Tags Box
return $fields;
}//* Remove the site title
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );//* Remove the site description
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );//* Register widget areas
genesis_register_sidebar( array(
'id' => 'after-entry',
'name' => __( 'After Entry', 'sixteen-nine' ),
'description' => __( 'This is the widget that appears after the entry on single posts.', 'sixteen-nine' ),
) );vangelisbelMemberIm sorry I wrote the wrong code before. I edited my first message.
The code i used is:
//* Customize the post meta function
add_filter( ‘genesis_post_meta’, ‘sp_post_meta_filter’ );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = ‘[post_categories before="Categories: "]‘;
return $post_meta;
}}but as I told you before, it doesn't work. Any ideas?
vangelisbelMemberI forgot to mention that obviously the full-width and full-height page template will need to have a 240px left margin because of the left sidebar where the menu is.
Thanks!
-
AuthorPosts