How can I eliminate the inline styles included by default with the Genesis framewrok?

The first inline CSS is added by WordPress automatically when you are logged in and viewing the front end. It is part of the CSS for the WordPress adminbar. <style type=”text/css” media=”screen”> html { margin-top: 28px !important; } * html body { margin-top: 28px !important; } </style> For the second part of the inline CSS … Read more

Select full Image Size on widget “Genesis – Featured Posts”

If you replace genesis_get_additional_image_sizes(); with genesis_get_image_sizes() you can choose any size image for the widget thumbnail. Replacement featured-post-widget.php is available on GitHub. And here is the replacement code: $sizes = genesis_get_image_sizes(); foreach( (array) $sizes as $name => $size ) echo ‘<option value=”‘.esc_attr( $name ).'” ‘.selected( $name, $instance[‘image_size’], FALSE ).’>’.esc_html( $name ).’ ( ‘.$size[‘width’].’x’.$size[‘height’].’ )</option>’;

Problem with WordPress query on page using custom fields

Edit :// try this: <?php add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ ); function sk_display_custom_fields() { /*Wordpress loop*/ global $wp_query; query_posts(array( ‘post_type’ => ‘sammenligne’ )); while(have_posts()) : the_post(); ?> $navn = get_field( ‘navn’ ); $type = get_field( ‘type’ ); echo ‘<p>’,$navn , ‘__’, ‘$type’,'</p>’); endwhile; wp_reset_query(); } add_action( ‘genesis_entry_header’, ‘sk_display_custom_fields’ ); genesis(); UPDATE:// Ok I tested ACF’s now. With … Read more

add_action and remove_action if custom field exists

I’m not clear on how your code works as-is, as I mentioned in my comment. It looks like you’re adding an action to call a function inside the function that you want to call with that action. If nothing outside the function invokes it, it never runs. add_action( ‘template_redirect’, ‘check_breadcrumb_condition’ ); function check_breadcrumb_condition(){ global $post; … Read more

Genesis: How to add content after aside and before the content-sidebar wrap

If you look in lib/structure/layout.php, towards the bottom, you’ll see: add_action( ‘genesis_after_content’, ‘genesis_get_sidebar’ ); /** * Output the sidebar.php file if layout allows for it. * * @since 0.2.0 * * @uses genesis_site_layout() Return the site layout for different contexts. */ function genesis_get_sidebar() { $site_layout = genesis_site_layout(); //* Don’t load sidebar on pages that don’t … Read more

Custom Post Type Loop throws 500 error when used in widget

There are several problems in your provided code. $query -> while( have_posts() ) The WP_Query() return type is object. You are referring to a method that doesn’t exist. Instead, you should use the following: while( $query->have_posts() ) {…} wp_reset_postdata(); inside the conditional This function resets the post’s data, as it suggests. If you use it … Read more

WordPress Genesis custom taxonomy archive shows 3 repeats of each post

You are using a nested loop in your code. You should only use the foreach loop, and pass the post ID to get_field(). Here’s an example: $terms = get_terms( [ ‘taxonomy’ => ‘collection_categories’, ‘orderby’ => ‘name’, ‘order’ => ‘DESC’ ] ); // Rest of the code here foreach ( $posts as $post ) { //* … Read more