• Resolved Bojan

    (@bojanbilly)


    Hi!

    I would like to put an image or icon in front of post title. I’ve managed that with .single .post-title:before in css
    BUT, I wanted to have different images or icons for some posts. Can I just put
    <img src="https://blabla/blabla/blabla.png" /> before post title? Is it safe to do it that way or it would make some problems?
    p.s. I tried and it worked, but I’m not a coding expert, so I dont’t know if some theme or WP update can overwrite it.

    Btw, the best theme ever!

    Thanks in advance,
    Bojan

    • This topic was modified 7 years, 11 months ago by Bojan.
    • This topic was modified 7 years, 11 months ago by Bojan.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello BojanBilly,

    The best way to do this would be to use Advanced Custom Fields. You can simply add an image field for a specific post type and put a shortcode for the image field before the post title in either archive.php or single.php of your theme.

    This way, if you add a new post, you can upload an image and it will pop up right before the post title, instead of doing this manually all the time.

    Hope this helps you.
    Take care!

    • This reply was modified 7 years, 11 months ago by FadingMusic.
    Thread Starter Bojan

    (@bojanbilly)

    Hi FM,

    Thnak you for your reply. I’m not very familiar with custom fields, but I would like to try it.
    If you could tell me one more thing: if I want 5 title posts to have one image, 7 post other image, 3 posts some third image etc. can I do that with this plugin? To be more precise, if I have 150 posts, I can put different image for each one of them?

    Thanks,
    B.

    • This reply was modified 7 years, 11 months ago by Bojan.

    Hi @bojanbilly,
    You can also hook into it using filters.
    Check this out for the filters available:
    https://presscustomizr.com/customizr/hooks-api/#hooks-api-single-post

    Hi @bojanbilly

    p.s. I tried and it worked, but I’m not a coding expert, so I dont’t know if some theme or WP update can overwrite it.

    Any custom code in Hueman Theme will be gone when you do a theme update.
    In WordPress, a theme update is actually automatically deleting your existing theme and installing latest copy from www.remarpro.com server. It does not merge files.

    For customization, you need to use template overriding in a child theme.
    https://docs.presscustomizr.com/article/239-using-a-child-theme-with-hueman

    WordPress update does not affect theme.
    Hueman theme update does not affect your own custom child theme.

    Hope the above information helps.

    Thank you

    Thread Starter Bojan

    (@bojanbilly)

    Wow, thank you all very much!
    You helped me a lot.

    Tkhank you once more ??

    Hi @bojanbilly,

    You are welcome.
    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post title image’ is closed to new replies.