pootlepress / sfx-page-customizer

Page Customizer for Storefront
0 stars 0 forks source link

Are we able to show/hide titles of archive pages #8

Closed nickburne closed 9 years ago

nickburne commented 9 years ago

Are we able to show/hide titles on archive pages such as the blog archive page and the shop archive page?

shramee commented 9 years ago

Ahoy! These pages never told their right Post IDs(but the ID of the first post, ie the latest post or the product contained). We are now able to do it for the shop page. StoreFront doesn't have html for the title of the page for a blog page. I tried to get it done via

add_action('storefront_loop_post', 'the_title'); add_action('storefront_single_post', 'the_title'); add_action('storefront_page', 'the_title');

but none seemed to give the desired results. So we got it done using jQuery. Prepended <header class="entry-header blog-header"><h1 class="entry-title" itemprop="name"><?php $current_post_id = get_option( 'page_for_posts' );echo get_the_title($current_post_id); ?></h1></header> to #main, Added class blog-header to hide only the main title (it hid all the titles of all the posts on the page which didn't seem right to me).

So that's pretty much it for now kindly lemme know how it works for you.

One last thing: Since by default the title is not visible I've currently set it to appear only if its explicitly set to show, is that all right?

nickburne commented 9 years ago

To confirm I do NOT want this implemented yet. Just research.

The jQuery solution means this happens after the page loads. Correct?

shramee commented 9 years ago

Yep, right. Removed jQuery prepend, We are still able to do it for the shop (courtesy get_option( 'woocommerce_shop_page_id' )) without jQuery.

nickburne commented 9 years ago

Ok - but not blog archive page? Just trying to understand why not...

http://codex.wordpress.org/Function_Reference/post_type_archive_title

shramee commented 9 years ago

Yep we can retrieve the post type title, I did it by using $current_post_id = get_option( 'page_for_posts' );echo get_the_title($current_post_id); The question is where to populate it. Using jQuery we prepend it to #main.

nickburne commented 9 years ago

Ok, i understand. Let's wait on this for a bit. I will assign to Jordan for discussion with me when he starts...

nickburne commented 9 years ago

@jordankeats Discuss with Nick!

nickburne commented 9 years ago

James K said: You should be able to use is_archive() for blog archives? Then is_category() for individual categories. You'll need to decide whether you want people to be able to have specific colors for specific categories though. I'm thinking they probably will...

nickburne commented 9 years ago

@shramee - woothemes said we should be able to use is_archive() for blog archives?

Would this work? Please confirm.

shramee commented 9 years ago

Will discuss when you wake up ; )

nickburne commented 9 years ago

I'm ready.

shramee commented 9 years ago

Hi

shramee commented 9 years ago

Lemme just go through it once again : P

shramee commented 9 years ago

Yeah we can do it for categories, and even create individual category specific options for this.

shramee commented 9 years ago

The problem lies with the blog template which doesn't contain title, we can get the title but we can't need to put it somewhere I think client side scripting is our only option for that right now since its not there in the Blog template : (

nickburne commented 9 years ago

Ok - we don't need to worry about this anymore...