Tag: WordPress

  • Disqus and the Twenty Sixteen WordPress theme

    Many WordPress sites use the Disqus Comment System because it’s powerful, social, and adds some features not available with the standard WordPress comment system.1I sometimes use Disqus here at brentlogan.com. I installed it briefly while I tested it with Twenty Sixteen.

    Twenty Sixteen Is Not Designed For Disqus

    Unfortunately, the Twenty Sixteen WordPress theme2Twenty Sixteen is still in development and will released before the end of 2015. is not designed for Disqus. On narrow screens like smartphones, Twenty Sixteen displays Disqus full width against the left and right edges of the screen, which doesn’t match the layout of Twenty Sixteen. If you want Disqus to look good, you’ll need to make a slight tweak.

    A Simple Fix

    Fortunately, making Disqus fit in with the rest of Twenty Sixteen is simple. Just add the following CSS to your site:

    #disqus_thread {
        margin: 0 7.6923% 3.5em;
    }
    @media screen and (min-width: 56.875em) {
        #disqus_thread {
            margin: inherit;
        }
    }
    

    This CSS makes Disqus match the margins for the rest of your site. Disqus looks good at all screen widths, even on smartphones.

    Adding the CSS

    There are many ways to add CSS to your WordPress site, but a couple of the easiest are the Custom CSS module in the JetPack by WordPress.com plugin3If you’re not already using JetPack, I wouldn’t recommend it just for adding CSS. That would be overkill. and the Simple Custom CSS plugin. Both of these plugins document how to add CSS to your site.

    More advanced WordPress users might choose to use a child theme.

    Good luck!

    • 1
      I sometimes use Disqus here at brentlogan.com. I installed it briefly while I tested it with Twenty Sixteen.
    • 2
      Twenty Sixteen is still in development and will released before the end of 2015.
    • 3
      If you’re not already using JetPack, I wouldn’t recommend it just for adding CSS. That would be overkill.
  • Clean Archives Reloaded in Twenty Sixteen

    Clean Archives Reloaded is a great archives plugin for those of us who have used WordPress for a long time. I use it on my archives page because it can display a lot of post titles without overwhelming the reader.

    Twenty Sixteen is the default WordPress theme for WordPress version 4.4. I’m using Twenty Sixteen now.

    Twenty Sixteen is a “mobile-first” responsive theme. Its main menu collapses our of the way for smaller screens yet can be expanded with a touch. The items are spaced for easy tapping.

    Google’s Search Console1Search Console used to be called Webmaster Tools. highlights pages that are not mobile-friendly; it flagged my archives page because the post title links and month links were too close together.

    Here’s how to take the CSS for Twenty Sixteen’s main menu and apply it to Clean Archives Reloaded.

    Modify Clean Archives Reloaded

    The HTML structure of Clean Archives Reloaded doesn’t quite match the HTML structure of Twenty Sixteen’s main menu. To simplify the CSS, it was easier to change one line of clean-archives-reloaded.php. I changed

    $html .= '<li>' .  mysql2date( 'd', $post->post_date ) . ': <a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a>';
    

    to

    $html .= '<li><a href="' . get_permalink( $post->ID ) . '">' .  mysql2date( 'd', $post->post_date ) . ': ' . get_the_title( $post->ID ) . '</a>';
    

    This moves the date inside the anchor tag, simplifying its HTML structure.2I wonder if I can convince Alex Mills (Viper007Bond) to make the change in the official release.

    Make Custom CSS

    Next, I grabbed the CSS from Twenty Sixteen and searched for all the lines with .main-menu in them and modified those appropriate to Clean Archives Reloaded. Because I only wanted this new CSS to apply to smaller screen widths, I wrapped the CSS in a media query. This makes Clean Archives Reloaded use mobile-friendly formatting at the same screen width that Twenty Sixteen’s main menu.

    @media screen and (max-width: 56.875em) {
        .car-list {
            font-family: Montserrat, "Helvetica Neue", sans-serif;
        }
        .car-list ul a {
            box-shadow: none;
        }
        .car-list,
        .car-list ul {
            list-style: none;
            margin: 0;
        }
        .car-list li {
            border-top: 1px solid #e8e8e8;
            position: relative;
        }
        .car-yearmonth, .car-list a {
            color: #1a1a1a;
            display: block;
            line-height: 1.3125;
            padding: 0.84375em 0;
        }
        .car-list a:hover,
        .car-list a:focus {
            color: #007acc;
        }
        .car-list ul {
            display: none;
            margin-left: 0.875em;
        }
        .car-list {
            border-bottom: 1px solid #e8e8e8;
        }
        .car-yearmonth:after {
            -moz-osx-font-smoothing: grayscale;
            -webkit-font-smoothing: antialiased;
            display: inline-block;
            font-family: "Genericons";
            font-size: 16px;
            font-style: normal;
            font-weight: normal;
            font-variant: normal;
            line-height: 1;
            speak: none;
            text-align: center;
            text-decoration: inherit;
            text-transform: none;
            vertical-align: top;
        }
        .car-yearmonth {
            margin-right: 50px;
            padding-right: 2.25em;
        }
        .car-yearmonth:after {
            content: "\f431";
            position: absolute;
            top: 0.8125em;
            right: 0.625em;
        }
    }
    .post-sharing a, .car-toggler {
        background: #1a1a1a;
        border: 0;
        border-radius: 2px;
        color: #fff;
        font-family: Montserrat, "Helvetica Neue", sans-serif;
        font-weight: 700;
        letter-spacing: 0.046875em;
        line-height: 1;
        padding: 0.84375em 0.875em 0.78125em;
        text-transform: uppercase;
    }
    .car-toggler:hover {
        background: #007acc;
        color: #fff;
    }
    .car-toggler:focus {    
        outline: thin dotted;
        outline-offset: -4px;
        color: #fff
    }
    .car-list {
        margin-top: 20px;
    }
    

    There are many options for applying this custom CSS, from using a child theme, to using JetPack’s custom CSS module. I use a plugin that loads my custom CSS file.

    This is the result.

    Success!

    Update. I continue to update the CSS and screen capture as Twenty Twelve’s CSS continues to change during development. This is the CSS I’m using here now.

    • 1
      Search Console used to be called Webmaster Tools.
    • 2
      I wonder if I can convince Alex Mills (Viper007Bond) to make the change in the official release.
  • Happy Birthday, WordPress!

    Happy birthday, WordPress! (I started the party a little early…)

  • Blogan: 10th Anniversary Project Entry

    Blogan: 10th Anniversary Project Entry

    To celebrate WordPress’ upcoming 10th anniversary this May 27, 2013, Dougal Campbell proposes blogging the following topics. Here goes!

    When WordPress was first released in May 2003

    • I was 40 years old
    • I already had a web site
    • I had sold a domain name1It’s a five-letter, common word, dot com name that’s still parked…

    When I first started using WordPress in December 2004

    • I didn’t post under my real name, instead, I used blogan
    • Posting an image meant including a small thumbnail image in the top corner of the post
    • I thought I could change people’s opinions by writing about politics and religion
    • I hadn’t heard of link rot
    • WordPress themes were CSS files and some images and CSS Zen Garden was amazing!
    • WordPress was on version 1.2, named for Charles Mingus
    • There were 8,000,000 blogs, yet 62% of Internet users didn’t know what a blog is

    Since I first started using WordPress

    • I learned CSS, some PHP, and can navigate the WordPress codex
    • I have tried more WordPress themes than I can remember and provided a ton of support for the K2 theme on its forum
    • I lived by web stats, and now largely ignore them2Sour grapes?
    • I learned to appreciate responsiveness in web sites
    • I have tried About.me, App.Net, Blogspot, Facebook, 500px, Flickr, FriendFeed, Google+, Google Wave, Identi.ca, Instagram, LinkedIn, MySpace, new MySpace, Pinterest, Plurk, Posterous, Pownce, Prezi, RebelMouse, Slideshare, Quora, Twitter, Vizify, Yammer, and Youtube3And probably others… but still consider this WordPress blog to be my online home

    If you use WordPress, join in the fun!

    Hat tip: WordPress Tavern.

    • 1
      It’s a five-letter, common word, dot com name that’s still parked…
    • 2
      Sour grapes?
    • 3
      And probably others…
  • The ThemeShaper WordPress Theme Tutorial: 2nd Edition

    The ThemeShaper WordPress Theme Tutorial: 2nd Edition. How to build a WordPress theme from scratch, using the latest WordPress features. Good stuff.

  • Embed Your Quora Activity on a WordPress Page

    Embed Your Quora Activity on a WordPress Page

    Quora seems to be the next big thing. It’s certainly a very useful site interesting.

    I display my Quora activity on a WordPress page. It’s not hard. Here’s how you can do it, too.

    • Download and activate the RSSImport plugin.
    • Create a page and use the RSSImport shortcode to show your Quora RSS feed. Your Quora RSS URL is the URL you see when you click on your name in Quora with “/rss” appended to the end. For example, my Quora RSS URL is: http://www.quora.com/Brent-Logan/rss

    The shortcode you use can be as simple as (make sure the feedurl matches your Quora RSS URL):

    [RSSImport feedurl="http://www.quora.com/Your-Name/rss"]

    To give me more control in the display, I use a more complex shortcode:

    [RSSImport display="10" feedurl="http://www.quora.com/Brent-Logan/rss" displaydescriptions="true" truncatedescchar='' html="true" start_items='<ul class="quora">' end_items='</ul>' before_desc='<div class="description">' after_desc='</div>' start_item='<li class="item">' end_item='</li>']
    
    • Optionally, create some CSS to style your embedded Quora activity. I am using:
    /* ----- Quora Page ----- */
    ul.quora {margin: 0; list-style-type: none; }
    .quora li { line-height: 1.2; margin-bottom: 1em; border-bottom: 1px dashed #ddd; }
    .quora li>a { font-weight: bold; line-height: 1.4; }
    .quora .description { margin-top: 0; padding: 0 0 0 20px; line-height: 1.2; font-style: normal; color: #222; }
    .quora .description>div:first-child { text-indent: -20px; }
    .quora .user { color: #222; }
    .quora .rep { color: #222; }
    

    This CSS may not be pretty, but it styles the embedded Quora activity to look much like Quora.

    There are other ways to embed your Quora activity. The easiest is to use WordPress’ RSS widget to display your Quora RSS feed in a sidebar.

    Good luck!

    Update: My final CSS before deactivating my Quora page was:

    ul.quora {margin: 0; list-style-type: none; }
    .quora li { line-height: 1.2; margin-bottom: 1em; border-bottom: 1px dashed #ddd; }
    .quora li>a { font-weight: bold; line-height: 1.4; }
    .quora .description { margin-top: 0; padding: 0 0 0 20px; line-height: 1.2; font-style: normal; color: #222; }
    .quora .description li { padding-left: 2em; }
    .quora .description>div:first-child { text-indent: -20px; }
    .quora .user { color: #222; }
    .quora .user:hover { color: #fff; }
    .quora .rep { color: #222; }
    
  • Using Tr.im with Twitter Tools

    trimlogo I’m following the instructions found at the following sites to configure Twitter Tools to use the Tr.im URL shortening service.

    With luck <crossing my fingers, knocking on my head>, this will work.

    Update. Success!

  • I’m trying out the P2 WordPress theme

    I’m trying out the WordPress theme P2. I really like it. What’s interesting is that it doesn’t show post titles. Disconcerting, at least when the humor of the previous three posts depending on their titles being shown… Oops!

Search

Stuff

Made with

in

to

Copyright 2004-2023 Brent Logan

Thanks for visiting!

Brent Logan