Archived

This topic is now archived and is closed to further replies.

  • 0

Changing Font Type In Categories and Sidebar


Question

Posted · Report post

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.

Share this post


Link to post
Share on other sites

13 answers to this question

Posted · Report post

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:

 

https://gist.github.com/anonymous/001b9f2e2cd3c1174830

 

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.com/fonts#UsePlace:use/Collection:Permanent+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:

 

https://gist.github.com/anonymous/eae27368d5d32e077372

 

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

 

http://support.pagelines.me/docs/customization/custom-css/

Share this post


Link to post
Share on other sites

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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
#site .widget_categories .widget-title
  • "Archives" title in the sidebar
#site .widget_archive .widget-title
  • Links of different categories
#site .cat-item

 

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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".

Share this post


Link to post
Share on other sites

Posted · Report post

Could we have a link to your site please?

Share this post


Link to post
Share on other sites

Posted · Report post

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.

 

http://www.pagelines.com/store/plugins/pagelines-googlefonts/

 

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.

 

 

.hentry .entry-title {
    font-family: butcherman;
    margin: 0;
}
 

Share this post


Link to post
Share on other sites

Posted · Report post

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:

<div id="sidebar-wrap" class="">
<div id="sidebar1" class="scolumn">
<div class="scolumn-pad">

<section id="sb_primary" class="copy clone_1 section-sb_primary"><div class="copy-pad"><ul id="list_sb_primary" class="sidebar_widgets fix"><li id="categories-2" class="widget_categories widget fix"><div class="widget-pad"><h3 class="widget-title">Categories</h3> <ul>
<li class="cat-item cat-item-1"><a href="http://headstructure.com/category/art/" title="View all posts filed under Art">Art</a>

 

 

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

Share this post


Link to post
Share on other sites

Posted · Report post

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.

 

http://screencast.com/t/jcem9WrCxyB

 

To see our overview on finding and editing css check out http://support.pagelines.me/docs/customization/custom-css/

Share this post


Link to post
Share on other sites

Posted · Report post

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: 

.widget 
.widget-title {
    font-family: Permanent Marker;
}

 

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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":

<link href='http://fonts.googleapis.com/css?family=Font+Name' rel='stylesheet' type='text/css'>

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:

.widget_archive

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

Share this post


Link to post
Share on other sites