Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
416 views
in Q2A Core by
edited by

Despite the tactics of the main interface, we are still missing some things, some of which need manual repair and some that are difficult to fix

egaskme.comAs you can see here, everything is good, but it is difficult to put the user image near the vote or answer

I also tried to change the location of the notifications instead of the top one. Change under the heading Addana, which facilitates full control. Also, it is missing to have the lcon automatically assigned to any question while sharing on Facebook or others.

egaskme.comAll in all, the avatar does not appear despite the use of a paid theme

Q2A version: 1.8.5
by
Q&A and blog are different formats and I do not recommend trying to wrestle something running on Q&A software into a blog. There is dedicated software for blogging that is much better suited for this.

With that said, I don't really get what your question has to do with a blog anyway. Or what you're asking in the first place. Displaying a user icon next to the vote counter is not difficult, it just requires some adjustments to the theme. But to help with that you would need to show us what your desired end result should actually look like (e.g. by updating your question with a mockup picture). And I don't have the slightest idea what you mean by "automatically assign icon to any question while sharing on social media." So please elaborate on that as well.
by
I mean, the question and answer is characterized by a superior design and easy to use, but it has some shortcomings that only a software developer or a developer can do, for example if I want the questioner's picture to appear near the question on the home page
by
reshown by
I bought a topic called Mobile X, although the user's avatar did not appear in the same question on the main page. You can see that from here

<a href="https://egaskme.com">egaskme></a>

1 Answer

+1 vote
by

This is going to be a little long-winded, since your question isn't very specific, and the subject is rather complex.

The design of a web page is essentially controlled by HTML (defines the structure of a web page) and CSS (defines how the elements in that structure should be displayed in a browser). There's also JavaScript (allows for changing a page after the browser has loaded it), but I'll ignore that here for simplicity reasons.

Question2Answer uses PHP code to generate the HTML that is sent to the browser. For a question in the question list the HTML structure looks roughly like this:

<div class="qa-q-item-main">
  <div class="qa-q-item-title">...</div>
  <span class="qa-q-item-avatar-meta">
    <span class="qa-q-item-avatar">...</span>
    <span class="qa-q-item-meta">
      ...
      <span class="qa-q-item-when">...</span>
      <span class="qa-q-item-where">...</span>
      <span class="qa-q-item-who">...</span>
    </span>
  </span>
  ...
</div>

The class attributes in that snippet refer to CSS classes that define how the respective element should be displayed or if it should be displayed at all.

To modify the layout of the question list you need to adjust the PHP and/or CSS code according to your needs. CSS is pretty flexible, and for many design changes CSS alone should suffice. However, in some cases re-arranging an element also requires putting that element in a different place in the HTML structure. In that case you need to change the PHP code too.

Changes to the PHP code are implemented in the file qa-theme.php in your theme folder, where you override one or more methods from the class qa_html_theme_base in the file qa-include/qa-theme-base.php. I'd say q_list_item() and q_item_main() are probably the most relevant ones for your scenario.

Changes to the CSS code are done by modifying the file qa-styles.css, also in your theme folder. Beware that there may be different styles for any given element in the CSS, depending on whether the page is being displayed on a desktop or mobile system, so you need to pick the right one for your change. It could for instance be that the designer of your theme wanted to avoid cluttering the limited screen space of mobile devices and thus chose to hide the avatar in mobile view.

...