WordPress.org

Ready to get started?Download WordPress

Forums

BlackBird
Text with link above header (9 posts)

  1. saabti
    Member
    Posted 7 months ago #

    Hello

    I am quite new to wordpress and have created a website using the Blackbird theme

    What I would like to be able to do is add a small piece of text with links above the header in order to direct to a different language version of the site

    eg: english/spanish

    Please could someone indicate the best way of doing this?

    I don't need translation tools or anything like that - just a simple link!

    Thanks!!

  2. Jesin A
    Member
    Posted 7 months ago #

    You need to create a child theme for this. Following are the steps

    Create a directory - wp-content/themes/blackbird-child

    Create the following files with the code mentioned below it

    wp-content/themes/blackbird-child/style.css

    /*
    Theme Name: Black Bird Child
    Template: blackbird
    */
    @import url('../blackbird/style.css');
    
    .above_header li {
    	display: inline;
    	list-style: none outside none;
    }

    wp-content/themes/blackbird-child/functions.php

    <?php
    register_nav_menu( "above-header", "Above Header" );
    ?>

    wp-content/themes/blackbird-child/header.php

    Copy paste code from http://pastebin.com/CkSsQnPq

    Now go to Appearance > Themes and activate Black Bird Child.
    Go to Appearance > Menus, create and save a menu with your desired links.
    Go to the Manage Locations tab and and choose

    Above Header ----> <Your newly created menu name>

  3. saabti
    Member
    Posted 7 months ago #

    Thanks Jesin

    I followed these instructions but when I refreshed the page the whole website was messed up - I got scared so I deleted all the child folder

    I just retried doing exactly the same but it happened again

    I'm not sure what I'm doing wrong...

  4. Jesin A
    Member
    Posted 7 months ago #

    It must be a problem with the stylesheet code.

    Can you do it now and post your site's URL I'll take a look at it and tell you what to do.

  5. saabti
    Member
    Posted 7 months ago #

    Thanks!

    the site is 3mildeseos.com

  6. Jesin A
    Member
    Posted 7 months ago #

    Found what error you have made and why you made it.

    Have a look at http://3mildeseos.com/wp-content/themes/blackbird-child/style.css

    You have copied the code from my reply notification you got in your email. So instead of a single quote ' you have pasted &39 as your email message shows it that way.

    Come to this thread and copy it.

    You've done the same mistake in http://3mildeseos.com/wp-content/themes/blackbird-child/functions.php too

    So copy the code again from this thread.

    Copy all code as it is. Don't change even the comments section /* */

    After doing these changes go to Appearance > Themes and activate Black Bird Child

  7. saabti
    Member
    Posted 7 months ago #

    Ahhh I see!! All fixed now!! Thanks!

    One more question - if I wanted to move it to the right hand side instead of the left, how do I do that?

  8. Jesin A
    Member
    Posted 7 months ago #

    Edit the wp-content/themes/blackbird-child/style.css file and add the following code

    .above_header {
      float: right;
    }

    One more piece of advice, you should disable directory listing.

    Which means if you visit http://3mildeseos.com/wp-content/themes/blackbird-child/ it lists all files inside it which is not safe on a production environment.

    So edit your .htaccess file and add

    Options -Indexes

    Doing this will show a 403 Forbidden error if someone tries to access directories like this.
    To more about this setting read this article I've written.

    Also your PHP setup is configured to display errors in the frontend which is not good. Turn is off by adding the following in the .htaccess file

    php_flag display_errors Off

    I've written an article on this too.

  9. saabti
    Member
    Posted 7 months ago #

    Thanks Jesin! Very helpful info, I really appreciate it!

    I've read your articles and edited my .htaccess file with both lines, the only thing is, when I enter the second line

    php_flag display_errors Off

    my homepage comes up with 500 error message and I'm not sure what you mean by "check the syntax used in htaccess."

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.