Custom background to groups
Support Area › Forums › Foxy › Custom background to groups
Tagged: taxonomy group background
- This topic has 13 replies, 2 voices, and was last updated 13 years, 7 months ago by
cheltenhammedia.
-
AuthorPosts
-
August 2, 2012 at 14:56 #6976
cheltenhammedia
ParticipantHi bill,
We are currently trying to add a custom background to three groups under staff. We have added backgrounds to the main site, and vaious posts and pages with Background Per Page no problem and it works well.
But, we are having a real issue with trying to assign backgrounds to taxonomy=staff-group&post_type=staff. Is there a css way of doing this and if so where?
Any help much appreciated.
Anthony
August 2, 2012 at 16:17 #6978Bill Robbins
ParticipantAnthony,
Thank you for your business first of all. You can do that. I just posted directions for a restaurant that was doing the same thing to their menu day before yesterday. You can find that thread on this post.
Using the instructions on that post as the starting point, you’d only need to make a couple of changes. The spot that would be different in the code is this:
is_tax( 'menu-group', 'dogs' )Change that to this:
is_tax( 'staff-group', 'group1' )Then change the
group1to the slug of your staff group (there’s a description on how to find that in the other post). Repeat that for your other staff groups and that will add a unique background image for each group.If you run into any questions or trouble, let me know,
BillAugust 2, 2012 at 18:18 #6984cheltenhammedia
ParticipantAwesome Bill,
It worked a dream, many thanks.
August 2, 2012 at 18:19 #6985Bill Robbins
ParticipantFantastic! Let me know if you need anything else.
September 13, 2012 at 04:13 #7584cheltenhammedia
ParticipantMorning Bill,
Could you advise as to why when selecting various taxonomies (such as staff or menu) before the assigned background loads we are getting another pages background for a brief second, it is like a bleed over that then goes.
It really has us stumped, is this a result of the previous coding changes we made in August (above)?
Many thanks
Anthony
September 13, 2012 at 08:44 #7586Bill Robbins
ParticipantAnthony,
Any chance you could send over a link so I can take a closer look? The backgrounds are output via PHP so they are decided before the page is created. We’ll figure it out though.
Thanks,
BillSeptember 13, 2012 at 08:53 #7588cheltenhammedia
ParticipantHi Bill,
Here is the website:
login: guest
password: guestWhen flipping between the various section you will see what I mean. Thanks for having a look at this one.
Anthony
September 13, 2012 at 09:11 #7590Bill Robbins
ParticipantAnthony,
Thanks for sending the link (great looking site by the way).
I did see the background appear and disappear briefly until my browser cached all the background files. I took a look at your code and I think this is what’s causing the flash:
<style type="text/css" id="custom-background-css"> body.custom-background { background-image: url('https://www.wearefab.co.uk/wp-content/uploads/2012/09/welcome4.jpg'); background-repeat: no-repeat; background-position: top center; background-attachment: fixed; } </style>That’s setting an image as the site “background” which is visible shortly before the page background load. I believe if you take that out that will help.
If you have any questions or trouble, let me know,
BillSeptember 13, 2012 at 09:20 #7592cheltenhammedia
ParticipantAwesome Bill,
The ‘page per background’ plugin has a default background that you set for those pages that do not have a custom background and it was this that was causing the problem. We have removed it and it has sorted out the problem.
Many thanks for your help. It need a fresh pair of eyes.
Cheers
Anthony
September 13, 2012 at 09:41 #7594Bill Robbins
ParticipantNo problem at all. Sometimes all that’s needed is an extra set of eyes.
September 19, 2012 at 05:23 #7667cheltenhammedia
ParticipantMorning Bill,
Everything is now working fine on the site what with all the customisation done but we are still unable to assign a background to the NEWS* (blog) page. Do we need to add some coding to the custom-js.php like we did before (see above).
We have checked with Firebug and the background we assigned on the page (Background Per Page Plugin) is just not registering.
Any advice Bill?
Anthony
September 19, 2012 at 10:28 #7670Bill Robbins
ParticipantYou know you’re right; I don’t have an option there for the blog page background. You can add in an image file directly into the custom-js.php file though. Look for this spot:
<?php elseif (is_page() && has_post_thumbnail() ): ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?> {image : '<?php echo $image[0]; ?>'}and right below that paste this:
Then just replace the http://yoururl.com/image.jpg with the URL to the image you'd like to use. That will cause your image to be displayed on your main blog page and also archive pages too.
If you have any trouble, let me know,
BillSeptember 19, 2012 at 11:03 #7671cheltenhammedia
ParticipantThanks for this Bill, I add ed the coding but no joy. Still no background on the blog. Here is what we now have in the custom-js.php
ID ), ‘single-post-thumbnail’ ); ?>
{image : ‘‘}
{image : ‘http://www.wearefab.co.uk/wp-content/uploads/2012/09/news-background2.jpg’}
{image : ‘http://www.wearefab.co.uk/wp-content/uploads/2012/09/news-background2.jpg’}Checked the source and in Firebug but it is just not showing up anywhere.
Any ideas?
Anthony
September 19, 2012 at 11:47 #7672cheltenhammedia
ParticipantScrub that Bill, we have fixed it, there was a conflict in the gallery. The coding works great now. Many thanks again
Anthony
-
AuthorPosts
- The topic ‘Custom background to groups’ is closed to new replies.
