Forum Replies Created
-
AuthorPosts
-
Gakuranman
MemberFound the solution while browsing the Genesis source theme files. In archive.php we find:
genesis_do_posts_page_heading
Adding this line to the child theme removes the title from the Genesis posts page:
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
And of course, adding it back in a different place is just as easy:
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_posts_page_heading' );
Gakuranman
MemberI'm having the same problem. What is the specific hook to remove the blog page title but leave the post titles intact on the page?
For example, the following code in functions.php with remove titles from all pages and archive pages, but it does not work on the blog page. Tested on a fresh child theme Is this a bug?
add_action( 'get_header', 'child_remove_page_titles' );
function child_remove_page_titles() {
if ( is_page() || is_home() || is_archive() ) {
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}September 19, 2015 at 10:41 am in reply to: latest Genesis update causing CPT archive issues? #166090Gakuranman
MemberI figured this out after comparing my code to the Executive Pro Theme. It doesn't rule out a bug in Genesis, but it seems to be a peculiar WordPress issue. So many hours wasted because of this :(.
Basically, when registering a custom post type, you can set a true/false value for: exclude_from_search. This determines whether the custom post type appears in search results on the blog. However, setting this value to 'true' causes taxonomy archive pages to return no results. So, the value must be set as below to avoid this issue:
'exclude_from_search' => false
To be fair, WordPress do note this on the custom post type page:
https://codex.wordpress.org/Function_Reference/register_post_type#ArgumentsThe bug ticket is below. Apparently it will not be fixed for the time being:
https://core.trac.wordpress.org/ticket/17592Edit: A workaround might be released in future: https://core.trac.wordpress.org/ticket/29418
September 19, 2015 at 2:26 am in reply to: latest Genesis update causing CPT archive issues? #166064Gakuranman
MemberDoes anyone have a working Genesis child theme which has a registered custom post type and uses taxonomies with archives they could share here? That would rule out if it's a Genesis issue.
September 17, 2015 at 10:34 am in reply to: latest Genesis update causing CPT archive issues? #165893Gakuranman
MemberDid this ever get sorted out? Having the same problems with the message 'Sorry, no content matched your criteria.' on custom post type taxonomy archive pages...
Gakuranman
MemberThanks for the follow up!
I found something incredibly odd. When I set Image_alignment to ' ' in the theme genesis_theme_settings_defaults, it does not register and sets the image to 'alignleft' instead. It results to this every time I click the 'reset settings' button.
However, when I use the code you provided utilising after_switch_theme as below, it sets my image alignment to ' ' after switching themes. This solves my problem and allows me to switch between themes without having to go back and setup the image alignment! Although frankly, I have no idea why setting image_alignment under the defaults does not work. A bug perhaps?
In any case, thanks for sticking with me. We got there!
//* Theme Default Settings
add_action( 'after_switch_theme', 'test_theme_setting_defaults' );
function test_theme_setting_defaults() {if( function_exists( 'genesis_update_settings' ) ) {
genesis_update_settings( array(
'content_archive_thumbnail' => 1,
'image_alignment' => '',
) );
}
}Gakuranman
MemberThanks so much for your time!
Yes, I understand how the child themes work. I'm building a new site and it's a pain to have to go back and change the settings every time I reload the theme and switch between others for. I haven't been able to find anyone implementing the image_alignment setting in their theme defaults yet, but I will continue to look.
Gakuranman
MemberHmm. It just doesn't seem to respond to any class at all; alignright, aligncenter, alignnone. Even tried '.alignright', but the theme always defaults to alignleft...
Can you see any coding errors below? The rest of the options are being read properly, so I don't think there are errors, but I could be overlooking something!
If not, could you show me an example where you've seen this parameter successfully changed in a theme before? If I can test a known working file, I can determine if there is something else affecting the code.
//* Theme Default Settings
add_filter( 'genesis_theme_settings_defaults', 'test_theme_settings' );
function test_theme_settings( $defaults ) {
$defaults = array(
'update' => 1,
'blog_title' => 'text',
'header_right' => 0,
'site_layout' => 'full-width-content',
'nav_type' => 'nav-menu',
'nav_extras' => '',
'nav_extras_enable' => 0,
'subnav_type' => 'nav-menu',
'redirect_feeds' => 0,
'comments_pages' => 0,
'comments_posts' => 1,
'trackbacks_pages' => 0,
'trackbacks_posts' => 1,
'breadcrumb_home' => 0,
'breadcrumb_front_page' => 0,
'breadcrumb_posts_page' => 0,
'breadcrumb_single' => 0,
'breadcrumb_page' => 0,
'breadcrumb_archive' => 0,
'breadcrumb_404' => 0,
'breadcrumb_attachment' => 0,
'content_archive' => 'full',
'content_archive_limit' => 100,
'content_archive_thumbnail' => 1,
'image_size' => 'featured',
'image_alignment' => 'alignnone',
'posts_nav' => 'prev-next',
'blog_cat_num' => 10,
'theme_version' => PARENT_THEME_VERSION,
);
return $defaults;
}Gakuranman
MemberHi Marcy,
Sorry for not being clearer. I need my image alignment to be centered or set to 'nothing'. I do not want it set to alignleft.
Any ideas?
-
AuthorPosts