Community Forums › Forums › Archived Forums › Design Tips and Tricks › Genesis Coach Needed
- This topic has 23 replies, 2 voices, and was last updated 8 years, 5 months ago by Porter.
-
AuthorPosts
-
November 5, 2015 at 11:36 am #170234continoMember
Howdy folks 🙂
I'm getting close to the finish line with my first Genesis project and have some issues I can't seem to resolve.Anyone know of someone willing and able to coach me ( preferably in real time through screen sharing) with a few genesis hook issues and a couple css snaffoos?
One example is I'm unable to have a widget area show at the bottom of single post pages with the following code (the before and after divs show but not the widgets):
genesis_register_sidebar( array( 'name' => 'After Blog Content', 'description' => 'This area is designed for a widget area after the content', 'id' => 'after-Blog-content' ) );
add_action( 'genesis_entry_footer', 'add_post_bottom_widget' );
function add_post_bottom_widget() {
echo '<div class="post-bottom-widgets"><div class="post-bottom-widgets-wrap">';
genesis_widget_area('after-Blog-content');
echo '</div><!-- post-bottom-widgets --></div>';
}Thanks!
Carl
November 5, 2015 at 11:59 am #170241PorterParticipantTry using the method below to register / display your sidebar. I've wrapped the widget display in an "is_singular" call to ensure it's not on the home page, and other areas it isn't required - remove that if you want. My guess is that your echo divs aren't actually showing up where you want them, due to the hook / way genisis_widget_area works, though I can't be certain. Either way, try this, see if you have any better luck. Be sure to change the names, hook, etc, just use this format with your info.
//* Regiester the widget area, this simply makes it exist. genesis_register_sidebar( array( 'id' => 'yourname-after-header', 'name' => __( 'YourName After Header', 'themename' ), 'description' => __( 'This is a widget area that can be placed after the post', 'themename' ), ) ); /* This displays the actual widget area, if conditions are met (on the front page or home), using a hook (we're using after_header). Change "genesis_after_header" right below this, to use a different hook. Try "genesis_before_content" if you wish.*/ add_action( 'genesis_after_header', 'yourname_after_header_widget' ); function yourname_after_header_widget() { if (is_singular()) { genesis_widget_area( 'yourname-after-header', array( 'before' => '<div class="after-header widget-area">', 'after' => '</div>', ) ); } }
November 5, 2015 at 12:14 pm #170247continoMemberThanks Porter 🙂
My divs ARE showing in the proper place (below the content) but not the widgets. I've tried using the array variation for the genesis_widget_area but no luck. I've also tried displaying other widget areas but they don't show as well.As a side note, for the home page, in front-page.php page, I have:
dynamic_sidebar('home-Left-Text');
which DOES show all the widgets.
Hmmmm
🙂
November 5, 2015 at 12:26 pm #170248PorterParticipantAre you able to toss a widget on the home page?
The widget is registering, and you can see it in the widget admin area?I'm not sure why it wouldn't show, as I use the exact code with the Genesis Sample theme and have many widgets on my home page just fine. I'm not sure if there's a plugin conflict, something in (or missing) from your page template, or if there's more complexity to displaying a widget area than I'm currently aware of.
November 6, 2015 at 12:04 pm #170334continoMemberPorter,
Finally figured it out. It doesn't like any capital letters in the id of the custom widget area when using as a hook. Strange because there are capital letters in widget areas that are coded into the home-page.php file.Does this make sense at all?
Bottom line ... it's working now 🙂
Thanks for your help!
Carl
November 6, 2015 at 12:11 pm #170336PorterParticipantSo the capital B in blog was throwing it off? That's really strange. I WAS going to suggest lowering it, simply to stay consistent, but I never would have suspected that would break it. I'll have to run a test to confirm that finding for my own curiosity (not that I don't believe), because it's so bizarre to me, especially after the point you made about defaults doing it.
Either way, glad you got it working!
November 7, 2015 at 11:12 am #170399continoMemberPorter,
Thanks again for your help. Might you have a moment for another question or two? I now have 48 hours to complete my first genesis project and am confused about a couple things:- I'm trying to remove the title of a post ONLY on single posts but not on the blog page. It doesn't want to do it IF I put it into an if statement like this (here's part of a function):
function post_feature_image() {
if (has_post_thumbnail() && is_singular() ) {
// PLACE H1 Title INSIDE FEATURE AREA
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
.
.
.Also it won't remove the meta for some reason.
Any ideas?
Thanks!
Carl
November 7, 2015 at 11:16 am #170400PorterParticipantI don't recall if I asked, but do you have a link to the site? Helping out is a lot easier if I can see what's going on.
Also, try adding this line inside of your if statement:
echo("this is being read!!!");
This is just to see what pages are meeting your conditions (has post thumbnail, and is singular). If you see that text, it's working, and the issue is with your hooks, if not, the issue is with your conditionals. Try that out and let me know! Also, pasting your entire functions.php to pastebin will help too.
November 7, 2015 at 11:29 am #170401continoMemberDo you live in front of your computer too? 🙂
http://packagingyourpassion.com/dev/RKA-1-NEW/wordpress/surrender-to-what-is/
Here's a link to the dev site ... you'll see your echo statement there. Notice on the single post that the title is in the gold box within the picture ... AND it's showing above ... you'll also see the result of the :before pseudo element that says "ON THE BLOG" in the very upper left of the site ... I'm trying to remove the default title (and the :before thing) with the code I showed. It ADDS ok, hence the title in the gold box ... but not removing.
🙂
November 7, 2015 at 11:45 am #170402PorterParticipantSo if I understand correctly (bear with me, coffee isn't hitting as hard as I'd like this morning), on the page you linked (a single post, compatible with is_singular), you need this line to work, which currently isn't:
remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
And you're saying the "on the blog" text is post meta, related to this line?
remove_action( ‘genesis_entry_footer’, ‘genesis_post_meta’ );
I'm not sure on that second bit, as I don't get how "on the blog" pertains to post meta, so clear that up if I'm misunderstanding. I see that "on the blog" is added via css, using content: "on the blog", which can be removed here:
.single h1.entry-title:after { content: 'ON THE BLOG'; font-size: 20px; padding: 20px 25px 20px 0px; border-bottom: 1px solid #000000; top: 15px; left: 35px; display: block; position: absolute; font-family: "halogen",sans-serif; }
If you want that on certain pages, and not on others, be as specific as you can, and we can write some CSS to make it show in some places, and not others.
As for the remove function not working, try adding a priority to the remove that happens LATER, maybe something is adding it back after you remove it:
remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ , 20);
That's just a guess, but it's worth trying. It seems to be the correct hook, and that's the right function to remove it, so there must be something else in a plugin / functions.php that's adding it back.
As for living in front of my computer, it depends on the day, but compared to the average person, yes 😀
November 7, 2015 at 12:06 pm #170405continoMemberThe "ON THE BLOG" is just part of the title as you'll see in the gold box and will go away for the top title if I can get the remove_action working. I add the ,20 to both the remove and add here:
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title', 20 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );add_action( 'post_feature_image', 'genesis_entry_header_markup_open', 5 );
add_action( 'post_feature_image', 'genesis_entry_header_markup_close', 15 );
add_action('post_feature_image', 'genesis_do_post_title', 20);But didn't do anything.
The meta I was referring to is for hiding the info that goes after a post. I took it out of the if statement above and made it global and IS removing it in all cases as I wanted ... so that part is good!
Now, if I could only get the darn title to hide above the single post (don't think it's a plugin ... only have a few) ..... man, this can be soooo challenging ... and part of the fun I suppose! 🙂
November 7, 2015 at 12:26 pm #170408PorterParticipantHmm, try moving the remove to the beginning, as the first item within the if statement. Maybe something about removing the header markup is making it so the remove can't target the area - just a guess. So try adding:
remove_action( 'genesis_entry_header', 'genesis_do_post_title', 1 );
That'll make the remove happen before the markup is removed, and if that works, we now know that the markup is required for the hook to function (I don't know to a detail how it works, so I'd like to learn this myself).
November 7, 2015 at 12:37 pm #170412continoMemberNo joy 🙂
Also, noticing another remove issue. I'm trying to move the comments to the entry footer, which it DOES but again, I can't remove it, so now you'll see 2 comment forms. Here's the code for this:
remove_action( 'genesis_after_post', 'genesis_get_comments_template', 1 );
add_action( 'genesis_entry_footer', 'genesis_get_comments_template' );November 7, 2015 at 12:39 pm #170413PorterParticipantSo basically all of your add functions are working, but none of your remove functions are working?
November 7, 2015 at 12:46 pm #170414continoMemberRemoves are working for pages but not for posts .... hmmm, is there something about posts being in a loop but not pages so the removes aren't running for posts?
November 7, 2015 at 12:53 pm #170416continoMemberAlso just noticed:
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
DOES remove the post info on a POST ... so that's the only one that's working for a post as far as I can tell.
Such a mystery!
🙂
November 7, 2015 at 12:55 pm #170417PorterParticipantJust to confirm it's not a priority issue, try changing the priority of the post info to 1, and the title to 12. I want to ensure that removing post info still works at 1, and see if the title works at 12.
November 7, 2015 at 1:12 pm #170420continoMemberChanging priorities didn't do anything. If I take out the remove info entirely, the title is still showing ... even if I put the remove actions out of the conditional loop, it still does nothing. Here's the latest:
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title', 20 );remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); // REMOVE INFO BELOW IMAGE
November 7, 2015 at 1:14 pm #170421PorterParticipantCan you use pastebin to show your entire functions.php? I'm perplexed by what's going on, have to leave semi-soon, and need my brain to be at ease.
November 7, 2015 at 1:23 pm #170422continoMemberHey man ... really appreciate your time on this ... here's the entire functions.php:
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.