Support » Theme: Capoverso » Social icons on homepage

  • I want social icons on the homepage but without the text. How do I accomplish this?

    By default it’s:
    [icon] Instagram

    I want:
    [icon]

    I only want to display social icons on the home page menu. I wish to keep the social icons with the text in the primary menu (displayed in sidebar).

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi there,

    Could you send over a link to your site so we can have a look?

    @dcoleonline I have no site to link (it’s local on my computer) but I took a screenshot.

    Default

    The image above is what it looks like by default.

    What I want

    The image above is how I want it.

    However, I want it to continue to look as it does in the image below which is by default (primary menu, not home page menu). I don’t want the above changes to affect the primary menu (if they would).

    Primary menu by default

    Thanks!

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    Hi there – David & I both looked and we don’t see a simple way to hide the text and keep the icons displayed, with CSS alone.

    You could try removing the social-media URLs from your Home Page Menu (keeping them in the Primary Menu) and then creating a child theme with a second menu on the front page next to the first, or perhaps hard-coding the social-media icons in if you don’t plan to change them frequently. That’ll take some PHP/CSS/HTML skills.

    Making a child theme means your changes won’t be overwritten when you update the theme. If you’re new to child themes, you can explore these guides:

    http://codex.wordpress.org/Child_Themes
    https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

    Here’s a guide to adding a new menu area:
    http://www.wpbeginner.com/beginners-guide/how-to-add-navigation-menu-in-wordpress-beginners-guide/

    Be sure not to touch the original theme files – only make changes in a child theme.

    @zoonini I failed to create a child theme (I have created child themes before but it was a long time ago).

    This is just with style.css

    I tried to create the following functions.php (I guess I need it?)

    <?php
    function my_theme_enqueue_styles() {
    
        $parent_style = 'capoverso-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'capoverso-child',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>

    However, it did not help. What am I doing wrong?

    I also noticed that Capoverso from wordpress.org is on version 1.0.3 and Capoverso on wordpress.com is at 1.0.4. Should I use the version from wordpress.com instead (as parent theme)?

    I added the following to style.css and then it looks right
    @import url("../capoverso/style.css");

    I read that this is the “old way” now and that you should use functions.php instead.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    @rebecka – try the simpler function from the Codex instead of the one you were using:

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }

    Don’t use a closing PHP tag – that’s the best practice for functions.php.

    Remove the @import line from your stylesheet.

    Let me know how it goes.

    I also noticed that Capoverso from wordpress.org is on version 1.0.3 and Capoverso on wordpress.com is at 1.0.4. Should I use the version from wordpress.com instead (as parent theme)?

    I’ll look into this.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    @rebecka – we’ve submitted a new version of Capoverso to WordPress.org and you should see the update notification in your dashboard within the next day or so!

    @zoonini Thanks. It’s working now.

    The theme is still on version 1.0.3. I hope they approve the new version soon.

    Now I’ll take a closer look at how to create a second menu.

    If I choose hard-coding instead, where and how do I do that? To get them right/after the homepage menu?

    I may want to place social icons in the footer instead. I know where I’m editing the footer. However, I wonder how I get the same icons as in the menu?

    How could the code of a social icon look like? Thinking of hard-coding now directly in footer.php

    Btw I tried to make a CSS change (I want to underline active links) but it does not work. Not even with !important after. Why doesn’t my CSS work for my child theme?

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    The theme is still on version 1.0.3. I hope they approve the new version soon.

    Thanks for the heads-up – this should be sorted now; the 1.0.6 update had been stuck but should be available now.

    I may want to place social icons in the footer instead. I know where I’m editing the footer. However, I wonder how I get the same icons as in the menu?

    If you’d like icons in the footer, there’s an easier way than coding them into a child theme. Capoverso comes with a footer widget area, so you could try adding a social icons widget like the one that comes with Jetpack, or a standalone plugin for social icons.

    Btw I tried to make a CSS change (I want to underline active links) but it does not work. Not even with !important after. Why doesn’t my CSS work for my child theme?

    You might not be targetting a specific enough element.

    Try this:

    .entry-content a {
      text-decoration: underline;
    }

    @zoonini

    If you’d like icons in the footer, there’s an easier way than coding them into a child theme. Capoverso comes with a footer widget area, so you could try adding a social icons widget like the one that comes with Jetpack, or a standalone plugin for social icons.

    It would have been a good solution but the problem is that the footer widget area is only visible on pages and not on the homepage. I want the icons to appear on the homepage as well.

    Perhaps it is easier to add the footer widget area to the homepage than to code something completely new?

    You might not be targetting a specific enough element.

    Try this:

    I tried your code too, but it did not work anyway. 🙁

    On the other hand, I discovered that after installing Jetpack, I got “Additional CSS” under Appearance > Customize. I paste the code there instead and it worked. But what is the point of having a child theme then?

    If I display the footer widget on the homepage, I wonder how to get social icons in the footer as in this picture.

    I do not want any title but only the icons like this one after the other.

    If I create a social custom menu and use custom menu widget in footer, it looks like this now.

    I do not want to include the text or that they are listed below each other. I want the icons next to each other on the same row (without text).

    I just want to do this if I can view the footer widget area on the homepage.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    I tried your code too, but it did not work anyway. 🙁

    Hmm, odd – I’m not sure why it didn’t work; it worked in my browser inspector.

    On the other hand, I discovered that after installing Jetpack, I got “Additional CSS” under Appearance > Customize. I paste the code there instead and it worked. But what is the point of having a child theme then?

    A child theme is useful when you need to make changes beyond just CSS, such as HTML, PHP, JavaScript. The Jetpack CSS editor – or the CSS editor built into WordPress core as of verion 4.7 – is useful for CSS, but cannot be used for other types of code changes.

    So – if you’d like to get the footer widget displaying on the static homepage, you’d need to copy the file footer.php into your child theme folder, and change line 12 from this:

    <?php if ( is_active_sidebar( 'sidebar-footer' ) && ! is_page_template( 'home-page.php' ) ) : ?>

    to this:

    <?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>

    That removes the condition that hides the footer widget area from the front page.

    At that point I’d need to see your site directly to help with any CSS you need for the footer widget, or if you’re using the Jetpack social media icon widget, let me know and I can see what I can do from here.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Social icons on homepage’ is closed to new replies.