[Support request] Font-family, Excerpt and Sidebar Width

Home Forums Support [Support request] Font-family, Excerpt and Sidebar Width

Home Forums Support Font-family, Excerpt and Sidebar Width

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #215336
    Derek

    ** I aplogize if this was already posted; I thought I did but couldn’t find it so I’m posting it again. **

    Hey Tom,

    I’m a Chinese/English bilingual blogger and I have a few issues that most other users may never have (to be fair, these issues come with most English themes, not just GP):

    1. Many Chinese font-families do not exist in the typography dropdown menu — and Chinese characters almost certainly don’t look good if I just choose one English font family.

    To make sure both English and Chinese characters look good in different operating systems, Chinese web designers usually have to do something like this:

    {font-family: Helvetica, Arial, “Microsoft Yahei”, “Hiragino Sans GB”, “Heiti SC”, “WenQuanYi Micro Hei”}

    My question is: how can I add such a “customized” font family combination to the dropdown menu? That would make your work much more appealing to me — and other Chinese/bilingual bloggers.

    2. The default method of cutting down an excerpt with “excerpt length” won’t work with Chinese characters. I’m not a PHPer, but I know most Chinese WordPress designers have to use a different method, something like this:

    <?php echo mb_strimwidth(strip_tags(apply_filters(‘the_content’, $post->post_content)), 0, 200,”…”); ?>

    I understand this may be entirely irrelevant to the majority of your users, but can you point me to the correct way of replacing the current method with this one, so it works with Chinese characters?

    3. (This issue is not about Chinese characters) Can we set a fixed width of sidebar? Instead of 25% of the total width, I want my sidebar to always be 300px width. How can we do that?

    Thanks for your great work!

    Derek

    #215446
    Tom
    Lead Developer
    Lead Developer

    Hi Derek,

    1. Currently, there’s no easy way to insert your own fonts into the Customizer options (there should be though, noted). However, you can quite easily add your own CSS so those required fonts will be added. If you need help targeting a specific element, let me know.

    I’ll definitely look into adding a filter so new fonts can dynamically added into the Customizer options.

    2. Interesting – I know that WordPress.org doesn’t allow themes to add custom excerpt functions like that, so you would have to overwrite the content.php file in your child theme, and replace the_excerpt() function with the above function. I wonder why WordPress hasn’t added something into the the_excerpt() function that handles Chinese characters. Might be worth a trac ticket.

    3. Unfortunately this isn’t possible due to the nature of responsive design. The grid uses percentages in order to be responsive/mobile friendly. Setting the sidebar width to pixels would throw off the responsive design.

    I really appreciate your post – you’ve given me a lot to think about.

    Let me know if you need more info 🙂

    #215455
    Roberto Enrique

    Tom is superfast 🙂 Here’s my answer (which is not very difernt BTW)

    Regarding the chinese font in the dropdown menu, i think that’s something that requires a some heavy work (although i really think that this should be addressed somehow in future releases) but for now, using a plugin that lets you add custom css (like Simple CSS) you should be able to add this:

    
    body {
    font-family: Helvetica, Arial, “Microsoft Yahei”, “Hiragino Sans GB”, “Heiti SC”, “WenQuanYi Micro Hei”;
    }
    

    and let the customizer options on “inherit”. That should do the trick.

    For the lenght of your excerpts you should use a child theme with some code that modifies what’s showing there (unfortunately I can’t give you advice on that) or the character count of the excerpts.

    Percentage based with of the sidebars is something that is directly related to how the unsemantic.css treats widths on the theme so everything is cleanly responsive. If you want your sidebar to be wider on desktop you can always enlarge them using the customizer settings.

    #215467
    Tom
    Lead Developer
    Lead Developer

    Ha, great minds think alike! Great post, Roberto 🙂

    #215908
    Derek

    Hey, Tom and Roberto, thanks for the quick feedback (and the solution to #1). I’m playing with child theme right now 🙂

    #215954
    Tom
    Lead Developer
    Lead Developer

    Glad we could help 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.