• Resolved Mikuda

    (@mikuda)


    First of all Hello!
    I need some help obviously – barely few days in wordpress.
    I have rough knowledge about code and CSS and I’m definately not a coder.
    Here is my site https://www.3k6hobby.com – (mostly dummy data as it’s work in progress) I started off with twenty-thirteen theme but already modified it to my liking.

    First question is about menu items customize. I used this code in CSS
    to move language selector “PL” to the right side:

    .main-navigation ul li:last-child {
    	float: right;
    	font-weight: normal;
    }

    As You can see it worked BUT:
    – why won’t it go all the way to the right?
    – I used font attribute as experiment yet obviously it doesn’t work in this section of CSS. Where can I change font weight for ONE particular menu item? I tried here and there but it always affects either all or none.
    – “last-child” paramater seemed pretty obvious, so I found out there is “first-child” and “nth-child(n)” also. How can I use them to further tweak menu items positions AND color/weight etc? I.e I wanted to move “contact” and “PL” both to the right using above code, and they do sort-of but they swap places (PL goes before Contact). I know I can bypass this by changing menu item order in settings, yet for sake of education I’d like to know if there is CSS method to adjust this. ??

    Second question is about MOBILE version of this site (if You can try and access it). Question is much simplier, but maybe solution will be trickier: I like the layout and drop-down menu very much, I just want to move LANGUAGE-SELECTOR outside of drop-down to the right side of red bar. Is it possible? Which file (CSS, PHP) is responsible for mobile version layout?

    Thank You in advance for any help, and sorry if I could’n explain something properly!

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter Mikuda

    (@mikuda)

    So, step by step for dummies ??

    – create (in this case) “twentythirteen-child” folder

    – copy there ALL contents from original folder EXCEPT functions.php and folders (css, genericons, images, inc, js, languages)

    – add

    /*
     Theme Name:   Twenty Thirteen Child
     Template:     twentythirteen
    */

    on top of style.css

    – create brand new, blank “functions.php” file, and then insert in it:

    <?php
    function theme_enqueue_styles() {
    
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css');
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

    And thats ALL that should be in this file?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    copy there ALL contents from original folder EXCEPT functions.php and folders (css, genericons, images, inc, js, languages)

    Yeah that won’t hurt, but really you only need to copy in the template files that contain custom changes. If any.

    And thats ALL that should be in this file?

    Yes.

    Thread Starter Mikuda

    (@mikuda)

    Well, actually it still didn’t work (“fatal error” response)
    BUT I found “Child Theme Configurator” plugin that did the job right.
    Here is content of functions.php it created:

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
    // END ENQUEUE PARENT ACTION

    Thread Starter Mikuda

    (@mikuda)

    Now:
    -after update of original theme will my child theme remain intact?
    -can I copy all remaining files/folders (except style and functions)
    to child folder and remove/redownload original one to revert it to default settins?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I think I was trying to make sure that you weren’t enqueing 2 files unnecessarily. As it sounded like many CSS modifications were made to the style.css file, I thought it would be better to just use your Child Theme style.css file as a copy of the parent. Then not enqueue the parent. This plugin looks like it enqueued the parent theme stylesheet as well, but maybe there’s a setting to change that.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Oh wait, you probably don’t need a functions.php file at all. I really don’t like that Codex article on how to create a child theme, it has convinced people that they need this file.

    Maybe you do need this file, but what isn’t working is guessing what files you have and haven’t changed. You need to list out what you changed in your theme so that I can recommend how to carry those changes into the Child Theme ??

    Thread Starter Mikuda

    (@mikuda)

    Well, in the end solution turned out to be even more simpler.

    I found a procedure called “derivative-theme” instead of “child theme”
    – duplicated theme folder,
    – renamed to something desired,
    – changed name in style.css,
    And that’s all.

    In fact I don’t even understand entire “child-theme” fuzz anymore,
    since above method works much better O.o
    – you can edit theme as much as you like
    – you have access to all necessary theme files in the same directory
    – if You mess something up you can reinstall original theme and copy
    that one particular file that you need
    – you do not worry that surprise original theme update will
    override or conflict with your child-theme modification.
    – since you intend to redesign original theme, You don’t need
    it’s updates anyway.
    – it is completely new, independent theme that You have full control of

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That sounds like the right solution for you ??

    It was just what I needed, thanks!

    Thread Starter Mikuda

    (@mikuda)

    Thank You very much for help Andrew!
    I’ll certainly have more questions very soon, but new thread will be better.
    Glad to know our discussion was helpful to You monitimul!

    How about closing thread and mark SOLVED? ??

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Language switcher in mobile and menu child-items positions’ is closed to new replies.