Forum Replies Created
-
AuthorPosts
-
Brad WestMember
Your Google-Fu is weak grasshopper. These code snippets should get you where you need to go:
http://genesissnippets.com/custom-comments-html-output-with-genesis-framework/
Brad WestMemberI've dug around and can't find anything either. It seems something like this would work for you:
if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { set_post_thumbnail( $post, $thumbnail_id ); }
Only I don't know where to hook this. Not sure where Genesis loads the featured image. May at
genesis_init
?add_action( 'genesis_init', 'child_set_featured_image' ); function child_set_featured_image() { if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { set_post_thumbnail( $post, $thumbnail_id ); } }
Or maybe it could be done with a filter:
add_filter( 'genesis_get_image' , 'genesis_get_image_default' );
Brad WestMemberAssuming you want to switch <section> for <div> in the whole sidebar, something like this should work:
if ( function_exists('register_sidebar') ) { register_sidebar( array( 'before_widget' => '<div class="widget widget_text">', 'after_widget' => '</div>', ) ); }
If you do this it will not output your widget ID:
id="text-7"
.Brad WestMemberDoesn't look like you've added the function. You'll need something like this:
add_action ( 'genesis_loop', 'move_title_position' );
genesis_loop
might not be the hook you need, so play with that part till you find where it goes. This Visual Hook Guide might help.Brad WestMemberCheers David. I appreciate the help.
Brad WestMemberThat worked. Thanks so much David.
If I could push my luck, is there any documentation on when and how to use the priority settings? I understand how this works now that I see it, but I wouldn't have thought of it myself.
Brad WestMemberThat adds it after the content-sidebar-wrap like this:
`
<div class="content-sidebar-wrap">
<div class="wrap">
<main class="content">
<article class="entry">
<header class="entry-header"></header>
<div class="entry-content">
...
</div>
<footer class="entry-footer"></footer>
</article>
</main>
</div>
</div>
`
What I'm looking for is this:
`
<div class="content-sidebar-wrap">
<main class="content">
<article class="entry">
<header class="entry-header"></header>
<div class="entry-content">
<div class="wrap">
...
</div>
</div>
<footer class="entry-footer"></footer>
</article>
</main>
</div>
`
Brad WestMemberI tried that, but it's not adding them where I want them. I need the wrap inside the entry-content div.
Brad WestMemberI finally got it. Seems simple now:
remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt' ); add_action( 'genesis_after_content', 'genesis_get_sidebar_alt' );
This moved the secondary sidebar inside the content-sidebar-wrap like this:
<div class="content-sidebar-wrap"> <main class="content" ...></main> <aside class="sidebar sidebar-primary ...></aside> <aside class="sidebar sidebar-secondary ...></aside> </div>
Brad WestMemberIt's being developed locally on my computer. There is no URL yet.
Typically you have the following layout:
<div class="content-sidebar-wrap"> <main class="content" ...> <aside class="sidebar sidebar-primary ...> </div> <aside class="sidebar sidebar-secondary ...>
I'd like to move the main and two asides inside the same area. Something like this:
<div class="content-sidebar-wrap"> <main class="content" ...> <aside class="sidebar sidebar-primary ...> <aside class="sidebar sidebar-secondary ...> </div>
or like this, removing the content-sidebar-wrap:
<div class="site-inner"> <header class="entry-header ...> ... </header> <main class="content" ...> <aside class="sidebar sidebar-primary ...> <aside class="sidebar sidebar-secondary ...> </div>
Brad WestMemberThe content of the current file is fine. I just want it to display in a different place. Creating a new file wouldn't solve that, would it? The original
<aside class=sidebar ...>
code will still be output, no?Brad WestMemberI was finally able to get it working. For others who might be looking this was my solution:
<?php //* Template Name: TEMPLATE NAME add_action( 'genesis_entry_content', 'genesis_page_archive_content' ); add_action( 'genesis_post_content', 'genesis_page_archive_content' ); function genesis_page_archive_content() { query_posts( array ( 'category_name' => 'CATEGORY-NAME', 'posts_per_page' => -1 ) ); ?> <ul> <div class="custom-archives"><?php while ( have_posts() ) : the_post(); echo '<li>'; echo '<a href="' . get_permalink() . '">' . get_the_title() . '</a>'; echo '</li>'; endwhile; ?></div> </ul> <?php wp_reset_query(); } genesis();
Brad WestMemberI can't get that code to work. It says it must run inside the loop so here's how I've added to my template file:
<?php //* Template Name: Language Learning Archive add_action( 'genesis_entry_content', 'genesis_page_archive_content' ); add_action( 'genesis_post_content', 'genesis_page_archive_content' ); /** Replace the standard loop with our custom loop */ remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'custom-archive' ); function custom-archive() { $args = array( 'category_name' => 'language-learning', ); $wpsites_catposts = new WP_Query( $args ); // Your Custom Loop if ( $wpsites_catposts->have_posts() ) { echo '<div class="list-category"><ul>'; while ( $wpsites_catposts->have_posts() ) { $wpsites_catposts->the_post(); echo '<li><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . get_the_title() . '</a></li>'; } echo '</ul></div>'; } else { echo '<div class="list-category">No posts found for this query.</div>'; } wp_reset_postdata(); } genesis();
And as for the After Entry Widget, that will add the categories to all pages, no?
-
AuthorPosts