Jump to content


Photo
- - - - -

Changing Font Type In Categories and Sidebar

font customize sidebar css

Best Answer Danny , 27 March 2013 - 07:47 AM

Every widget is given a unique class, which you can use to style particular widgets. If you view the HTML code you provided above, you can see the following:

 

 

As you will notice, the categories widget has the following class:

 

widget_categories

 

You can use this to target that widget and that widget only, you can also see in the code above that the h3 has a class to:

 

widget-title

 

We can use these two classes, to target the categories widget and its title, by combining the two, which would look like this:

 

.widget_categories .widget-title

 

Now we need to get the correct integration code from Google Webfonts, which you can find here - http://www.google.co...ermanent Marker

 

So now we have the classes to target the widget and the h3 title, as well as the correct code for the font family, all we need to do now is combined them.

 

This would look something like this:

 

 

The reason as to why I am using #site and more information on how to implement custom CSS, can be found here.

 

http://support.pagel...ion/custom-css/

Go to the full post


  • Please log in to reply
13 replies to this topic

#1 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 26 March 2013 - 12:48 PM

Hey,

 

I was wondering how I could change the font type of my "Categories" list in the sidebar. 

 

For example right now my sidebar font is showing as Helvetica because under Site Settings > Typography > Text Headers, I have Helvetic chosen. But I would like to use the Google Font "Permanent Marker".

 

Firebug shows that my Categories are grabbing the font type from h3, but since Typography changes all headers at once I do not know how to customize this.

 

Please help!

 

Thank you.



#2 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 26 March 2013 - 12:52 PM

To be clear I would like to know how to change the font types of both the word "Categories" in the sidebar, as well as the font types of the links listed below such as "Art".



#3 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 26 March 2013 - 01:40 PM

Could we have a link to your site please?



#4 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 26 March 2013 - 02:04 PM

Yes of course, sorry about that.

 

Please Login or Register to see this Hidden Content



#5 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 March 2013 - 01:01 AM

Hi there, if you want to use google fonts for certain text areas on your site we have a free google font plugin you can install which will add all the fonts to your site so you can select them from the typography menu.

 

Please Login or Register to see this Hidden Content

 

If you're just looking to change the font for certain words or areas on the site you will need to use custom code. Make sure you have the google font plugin installed first and active, then you'll need to inspect the area in firebug and get the code where the font is being applied, then you can edit in your chosen font and paste into Pagelines>site options>custom code. An example is below.

 

 

Please Login or Register to see this Hidden Content



#6 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 27 March 2013 - 04:03 AM

Hey, I have been trying this in several different ways but I cannot figure it out.

 

I do not know which section or div container to attach the code to.

 

My "Categories" are under:

Please Login or Register to see this Hidden Content

 

 

But I still don't know what I have to insert into custom code.
 
I am sorry but I am a total noob!


#7 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 March 2013 - 05:10 AM

Hi there, its looks like you're looking in the correct area in the html. Once you've inspected the element in the html you need to look at the css in the right hand window, thats where you can make the edits and then copy/paste back into pagelines.

 

I've recorded a short video to show you.

 

Please Login or Register to see this Hidden Content

 

To see our overview on finding and editing css check out

Please Login or Register to see this Hidden Content



#8 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 27 March 2013 - 06:06 AM

Wow thank you very much! That was incredibly helpful! 

But I still cannot get my code to work :/

 

Here is the code I am putting into the custom code: 

Please Login or Register to see this Hidden Content

 

Do I have to put the "* G" next to the font name because it is a google font? I don't understand what I am doing wrong.



#9 Danny

Danny

    Is Awesome!

  • Moderators
  • 16923 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 27 March 2013 - 07:47 AM   Best Answer

Every widget is given a unique class, which you can use to style particular widgets. If you view the HTML code you provided above, you can see the following:

 

 

As you will notice, the categories widget has the following class:

 

widget_categories

 

You can use this to target that widget and that widget only, you can also see in the code above that the h3 has a class to:

 

widget-title

 

We can use these two classes, to target the categories widget and its title, by combining the two, which would look like this:

 

.widget_categories .widget-title

 

Now we need to get the correct integration code from Google Webfonts, which you can find here - 

Please Login or Register to see this Hidden Content

 

So now we have the classes to target the widget and the h3 title, as well as the correct code for the font family, all we need to do now is combined them.

 

This would look something like this:

 

 

The reason as to why I am using #site and more information on how to implement custom CSS, can be found here.

 

Please Login or Register to see this Hidden Content



#10 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 27 March 2013 - 12:57 PM

Great! This worked. Thank you very much!

But I do want to add that I was only able to make it work after I pasted this Google Web Fonts code into my Custom Code "Header Scripts":

Please Login or Register to see this Hidden Content


Is there a reason I needed to do this when I already had the Google Web Fonts plugin enabled?

Also, if I wanted to add this code for more than one section such as:

Please Login or Register to see this Hidden Content


How can I add these together instead of writing two separate lines of code?

#11 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 27 March 2013 - 02:38 PM

I'm not sure why this is - but at least it's working now!

 

Can you please clarify what you mean by adding that piece of code for more than one section?



#12 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 27 March 2013 - 04:28 PM

Yes me too!

 

And what I mean is I am able to change the fonts for each individual section, for example:

  • "Categories" title in the sidebar

Please Login or Register to see this Hidden Content

  • "Archives" title in the sidebar

Please Login or Register to see this Hidden Content

  • Links of different categories

Please Login or Register to see this Hidden Content

 

I was just wondering if there was a way to change the fonts for all of these sections at once. Do I separate with commas in their hierarchal order, or do I put them all in one bracket?



#13 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 March 2013 - 11:49 PM

Hi there, if you want to change all of the widget titles to that font you can just use the .widget title class, as each standard wordpress widget will use this.

 

If you want to target certain areas and make the change only once then you can put in the classes separated with a comma followed by the font-family command as you've described above, that will work.



#14 mason

mason

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 28 March 2013 - 08:50 PM

Great. Thank you very much for all of your help!







Also tagged with one or more of these keywords: font, customize, sidebar, css