Hero section for category
Support Area › Forums › Elite › Hero section for category
- This topic has 38 replies, 2 voices, and was last updated 8 years, 7 months ago by Bill Robbins.
-
AuthorPosts
-
August 30, 2015 at 12:57 #32366Grandemange JonathanParticipant
Hello Bill,
I saw in a post it was possible to make an hero section on a category page (I saw the Kerigma topic)
But i can’t find the Toxonomy-image.php on the elite theme so i ask you if is possible to make it in the elite theme ?
Thank you.
Jonathan
August 30, 2015 at 15:47 #32372Bill RobbinsModeratorHi Jonathan,
You could likely do that with Elite. Kerygma has that function built in so that podcast series can have graphics. There is a plugin called Category Images (https://wordpress.org/plugins/categories-images/) that I base that function on. You could use it to add in hero images for post categories.
Hope that helps get you pointed in the right direction.
Take care,
BillAugust 31, 2015 at 13:57 #32393Grandemange JonathanParticipanthello bill,
I installed the plugin, now i can make an image in the category post … But that didn’t appears in the category page :
http://www.femmedevaleur.com/?cat=6
The picture is loaded with success.
So i don’t know what to do =)
Thanks for your help
August 31, 2015 at 14:26 #32394Bill RobbinsModeratorThere’s a fair amount of customization that will need to be made to the hero-options.php file to make the images visible. Go to Appearance in your WordPress dashboard and click on Edit. From the files on your right, choose hero-options.php. Replace everything in the file with this:
And save your changes. I haven’t tested that code, but that’s basically what you’ll be trying to do there. Make sure the category images plugin is active or you’ll have an error on your category pages.
Hope that helps out,
BillAugust 31, 2015 at 14:32 #32395Grandemange JonathanParticipantI change the Hero-options.php and no pictures, no text and no article appears !
look: http://www.femmedevaleur.com/?cat=6
Thanks
August 31, 2015 at 14:36 #32396Bill RobbinsModeratorI made one change to the code above. Try it again.
August 31, 2015 at 14:41 #32397Grandemange JonathanParticipantThank Bill
The image work but look i got two text :
http://www.femmedevaleur.com/?cat=6
Can you help ?
Thank a lot
August 31, 2015 at 14:45 #32398Bill RobbinsModeratorYou can delete this line (line 81):
the_archive_description( '<div class="hero-caption">', '</div>' );
August 31, 2015 at 14:47 #32399Grandemange JonathanParticipantAugust 31, 2015 at 14:51 #32400Bill RobbinsModeratorThe title is the line above what you just deleted. You’re welcome to delete it too.
August 31, 2015 at 14:57 #32401Grandemange JonathanParticipantI work great, I got 2 questions more, Can we delete the blank between the picture and the text ? And do you know some plug in for reduce or make more beautiful the article under ?
I’m sorry for my noobisme =)
August 31, 2015 at 14:58 #32402Grandemange JonathanParticipantLike a banner for the article and you can clic on it to see the full article …
August 31, 2015 at 15:00 #32403Grandemange JonathanParticipantAnd another details can we make the black navigation menu be transparent on the image like other pictures ?
August 31, 2015 at 15:05 #32404Bill RobbinsModeratorTo change the header color and the spacing, add this to the Custom CSS box that’s in the Advanced tab of the Theme Options page:
body.category.archive #header { background: transparent; } body.category.archive #header.scroll-background { background-color: #1A1A1A; } body.category .wrap { margin-top: 0; }
For the actual posts, here’s what I would do. In the theme options page, choose the content tab. In the option to display the full post or an excerpt in the blog, choose the excerpt.
Then add a featured image to every post. That image will link to the full article and keep the actual blog page streamlined. That usually works out well.
Hope that helps out 🙂
August 31, 2015 at 15:18 #32405Grandemange JonathanParticipantOkay,
it’s already in excerpt but the image is huge, not like a banner do you understand because the article keep the image normal !
August 31, 2015 at 15:31 #32406Bill RobbinsModeratorWhen no sidebar is used, the content area is pretty big. You could always make it smaller by adding something like this to your Custom CSS:
.content-full .wrap { max-width: 960px; }
You’re welcome to make that smaller to shrink that whole area a bit. It’ll make the text a bit easier to read too by keeping the lines shorter.
August 31, 2015 at 15:40 #32407Grandemange JonathanParticipantThat don’t look like i want and other question is possible to create a specific picture (for an article) in the category page and a picture for the hero space in the article page ?
Because i i can’t modify the picture like i want can i make a picture specific for the category page ? And keep the original picture for the hero space in the article ?
August 31, 2015 at 15:46 #32408Bill RobbinsModeratorI guess that’s the thing. I don’t know what you want here. Why don’t you make a mock up of what you’re looking for so I have an idea and can tell you what options you have.
August 31, 2015 at 15:58 #32409Grandemange JonathanParticipantin my dreams =)
This what i would have :
Each Green square is an article with an picture, when you clic on the picture you go to the article.
Sorry I’m a noob you can look the image in attachments
Attachments:
August 31, 2015 at 16:39 #32411Bill RobbinsModeratorI think we can do that. If you’re planning on using this for everywhere in your blog (no typical blog pages), then do this:
- Go to the Appearance section in your WordPress dashboard and choose Edit.
- From the list of files on your right, choose index.php
- Replace everything there with this:
- Save your changes.
If you may sometime want a more traditional blog page too and only want to change your categories to be like this then do this:
- Using your web host’s control panel’s file browser or a FTP program to create a new file in the theme’s folder. It’ll be at wp-content/themes/elite/
- Call the file category.php
- Use the code above as the content of the file and save your changes.
Now you’ll need to specify the image to use. Go to the Media section of your WordPress dashboard and upload an image or find the image you’d like to use. In the pop up that comes up in the media library when you click on an image, you’ll see the URL to that image. Copy that.
Now edit your post where you want this image to be used. Scroll down below the main content box and you’ll see one for custom fields. If you don’t see it, click the screen options tab in the top right to make sure the checkbox by custom fields is selected.
In the left hand spot of the custom fields, enter “blog-image” and in the right hand section, paste the URL to the image. Then click the add custom field button. Update/publish your post.
Have fun,
BillSeptember 1, 2015 at 00:59 #32412Grandemange JonathanParticipantWow that work great !
Now the text is disappeared to the description of the category, i’ve already created category.php and add this line to make work CategoryTinymce :
<?php
if(!(is_paged())){
echo category_description();
}
?>May be that miss to make appears the text.
Thanks a lot again Bill you’re a Super Hero =))))
September 1, 2015 at 01:00 #32413Grandemange JonathanParticipantPS : the picture square is just a test =)
September 1, 2015 at 09:13 #32427Bill RobbinsModeratorHi Jonathan,
You’re welcome to add in the category description. I edited the Gist above to include it. Here’s the function:
<?php the_archive_description( '<div class="category-description">', '</div>' ); ?>
You may want to leave out the if ( ! is_paged() ) since that will take out the category description whenever the category has enough posts to go onto more than one page. It doesn’t remove the description from the second page, but all pages including the first.
Have a great day,
BillSeptember 1, 2015 at 15:03 #32450Grandemange JonathanParticipantHey Bill,
I want the description just on the first page not on the second what i do ?
September 1, 2015 at 15:36 #32452Grandemange JonathanParticipantAnd after some test can we make the difference topics more closer with the CSS ?
-
AuthorPosts
- The topic ‘Hero section for category’ is closed to new replies.