Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
169 views
in Themes by

Hello, I want to add a link to where the codes of the place I marked in the picture. Where should I add?

Q2A version: 1.8.6
by
Do you want to add another row to that menu with your custom content?
by
yes I want to add a new line. I'll add for sample private messages

1 Answer

+1 vote
by
selected by
 
Best answer

There are a few ways to do that. In any of them, you'll have to create whatever CSS you want to style it.

1. Open the qa-theme/<your-theme>/qa-theme.php file

2. Add (or merge, if it already exists) the initialize() function:

    public function initialize() {

        parent::initialize();

        if (qa_is_logged_in() && isset($this->content['navigation']['user'])) {

            $this->content['navigation']['user'] = array(

                    'google_search' => array(

                        'url' => 'https://www.google.com?q=' . urlencode(qa_get_logged_in_handle()),

                        'label' => 'Google your name!',

                    ),

                ) + $this->content['navigation']['user'];

        }

    }

3. Edit the url and label values in any way you want

4. Use a text that represents whatever you're adding instead of google_search

5. Add this to qa-theme/<your-theme>/qa-styles.css

.qa-nav-user-google_search:before {

    content: '\e812';

    font-family: "fontello";

    display: inline-block;

    width: 1em;

    background-color: #2c3e50;

    padding: 5px;

    margin: 0 10px 0 0;

    text-align: center;

    line-height: normal;

    border-radius: 1em;

}

Note the pattern to follow regarding google_search.

This is a bit SnowFlat oriented. You can change the icon by changing the content of \e812. SnowFlat includes icons ranging from 800 to 825. At the bottom of the qa-styles.css file you'll find a reference of what each icon contains. If you want more images, you'll have to import your own font, but I believe that's a completely different question.

by
Icons do not appear when you enter mobile
by
It works for me in mobile as well. You might be adding the CSS in the wrong part of the file. Just add it at the end
by
yes i added to the end of the css file
by
ok it works fine, I cleared chrome history problem fixed thank you very much
...