Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
664 views
in Q2A Core by
edited by
How can I edit h1, h2 and h3 tags on question page? I want to edit <h> tags in question page on Snowflat Theme

For example;

Normally; <h2>comment</h2>

but I want to do <h3>comment</h3>

Because there are too many <h2> tags on question page.

1 Answer

–1 vote
by
edited by
"Related questions" is a plugin, so you can edit its file(s). Let's say the file is qa-layer.php inside the folder plugins/related-questions. Search for H2 tags and change them.

Or you can do the trick with CSS. Let's say your related questions plugin is wrapped in a widget, say main widget. You can edit CSS with something like .qa-main-widget h2 {your custom css style here such as font-weight}

The H1 heading of the question title is another story. It belongs to Q2A core. You can change it in such file as  format.php in qa-include/app folder. (if I remember correctly)
by
Not only, related plugin. I can edit <h> tags on question page code. But i can not find in q2a files
by
Different <H> tags in different position of the site or within a page can be edited in different files.

I checked for you. The H1 tags for the Question title, for example, can be found in qa-theme-base.php. So, you copy that function code, customize in your own way, and paste the function into your theme file. For instance: Snowflat/qa-theme.php
by
If you simply want to make the <H> tags to appear a little smaller or bigger, you'd better edit your CSS file, instead of trying to edit the Q2A core.

Try things like these:

h1 {color:red}
h2(color:blue}

.qa-main h1 {
        font-size: 30px;
        font-weight: 500;
        line-height: normal;
        padding: 16px 8px;
        margin: 0;
        background-color: #eee
    }

.qa-q-view-content h2 {font-size: 23px}

.qa-template-question .qa-q-item-content h2 {color:yellow}

.qa-widget-main h2 {border-bottom:1px;}
...