Forum Replies Created
-
AuthorPosts
-
mmjaegerMember
Thanks for replying
quick question - let's say I've something like this in the url: ?view=xyz
how can I e.g. conditionally remove the post_thumbnail in that template file?
would this be the recommended way to do it:
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); add_action('genesis_entry_content', 'theme_do_post_image')
;
if ( isset( $_GET[ 'view' ] ) && $_GET[ 'view' ] == 'xyz') {
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
} else {add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
}`could this also be grouped together somehow if I have several add_action depending on the condition?
Thanks again
mmjaegerMemberso you're adding a secondary loop and not replacing the primary loop, right - does the pagination word on the secondary loop?
Thanks again.
mmjaegerMemberI'm still looking for some insight how to do this.
Thanks again.
mmjaegerMemberYes I did end it with genesis() - I basically have something like outlined at genesissnippets.com/genesis-custom-loop/ using a custom page template - everything works fine - I just don't know what the best way would be to show the page title since the custom loop replaces the primary loop, the page doesn't output its page title?
mmjaegerMemberI think I figured it out - thanks again.
add_filter('genesis_markup_content-sidebar-wrap', 'removing_div', 10, 2); function removing_div( $bool, $args) { return true; } remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt' ); add_action( 'genesis_after_content', 'genesis_get_sidebar_alt' );
mmjaegerMemberThat worked - thanks
However, I'm still kind of lost.
How could I get a markup something like:
`
<div class="wrap">
<main class="content">
<aside class="sidebar-primary">
<aside class="sidebar-secondary">
</div>mmjaegerMemberI'm using all custom fields so guess I have to have some sort of template - I like to optimize that code so I don't have that much duplicate code for single and archive pages
mmjaegerMemberbump
mmjaegerMemberI understand but as I interpret it I would still end up with 7 cpt archive files and 7 cpt single files - what I'm trying to do is basically use the standard single/archive file and use some sort of template for the cpt output which is basically identical for single and archive.
mmjaegerMemberactually, I don't have any taxonomies at all - maybe my question wasn't very clear.
mmjaegerMembercould this be a start? somehow I get the impression it's slowing down WordPress?!
add_action( 'pre_get_posts', 'ta_pre_get_posts' ); function ta_pre_get_posts( $query ) { if ( !is_admin() && $query->is_main_query() && in_array( $query->get( 'post_type' ), array( 'ta_case', 'ta_client', 'ta_event', 'ta_member', 'ta_opportuntiy', 'ta_position', 'ta_testimonial' ) ) ) { //* Remove the post content //remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); //* Add custom post content //add_action( 'genesis_entry_content', 'ta_custom_entry_content' ); //* add_action( 'get_header', 'ta_get_template_part' ); } return; } function ta_get_template_part() { $post_type = get_query_var( 'post_type' ); get_template_part( 'content', $post_type ); }
Somebody please help.
mmjaegerMemberanybody else has an idea?
mmjaegerMemberhow do I place that custom query onto a certain page - is that basically just a function in the functions.php file and then I check whether I'm on that specific page?
mmjaegerMemberAs to the sorting question, I kind of got it to work:
add_action( 'pre_get_posts', 'ta_custom_post_type_archive' ); function ta_custom_post_type_archive( $query ) { // do not modify queries in the admin if ( is_admin() ) return $query; if ( $query->is_main_query() && is_post_type_archive( 'ta_member' ) ) { $query->set( 'posts_per_page', -1 ); $query->set( 'meta_key', 'member_order' ); $query->set( 'meta_query', array( array( 'key' => 'member_order', ), array( 'key' => 'member_last_name', ) )); add_filter( 'posts_orderby', 'customorderby' ); return $query; } } function customorderby( $orderby ) { return 'mt1.meta_value+0 ASC, mt2.meta_value ASC'; remove_filter( 'posts_orderby', 'customorderby' ); }
didn't have a chance to check whether the code messes up anything else - where's the best place to put the add_filter... and the remove_filter...?
Thanks again
November 22, 2014 at 7:38 am in reply to: How to change the color of the current item in the breadcrumbs? #132488mmjaegerMemberHello
are you somewhat familiar with CSS - I would change the default color for the breadcrumbs to your desired highlight color - the current item is just text - then you also change the color of the breadcrumb links to a different color.
October 16, 2014 at 6:59 am in reply to: Gallery Captions layout problem on small displays (e.g. iphone) #127976mmjaegerMemberif I were you I would set the width of the .gallery-item to 100% on small devices
mmjaegerMemberwith all the help I got in this forum as you can see in the history of my post I was able to solve the problem
mmjaegerMemberany news on this one?
mmjaegerMemberI'll give that a try - thanks Brad
mmjaegerMemberI'm not so much worried how to organize my custom code, I'm wondering why 'genesis_setup' is not running when I include 'lib/init.php' at the top of my functions file?
-
AuthorPosts