Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Wordpress featured content question.

  • 20-01-2011 09:17PM
    #1
    Registered Users, Registered Users 2 Posts: 1,632 ✭✭✭


    Does anyone know how or if I can put a picture into the featured content without having to put the same picture in the post? (Wordpress site)


Comments

  • Registered Users, Registered Users 2 Posts: 16,415 ✭✭✭✭Trojan


    Quick answer: almost certainly you should be able to do it that way. However, like many WordPress questions, the answer to this one is "depends on what theme you're using". The theme authors should have made it so - you might need to add an image URL to a custom field.

    Can you give us more information about your theme or link to your site etc?


  • Registered Users, Registered Users 2 Posts: 1,632 ✭✭✭SuperWoody101


    I had someone do the site for me but can't get in contact with them now. http://www.fighthounds.com sorry for the lack of info. and thanks for the reply.


  • Registered Users, Registered Users 2 Posts: 1,802 ✭✭✭cormee


    Does anyone know how or if I can put a picture into the featured content without having to put the same picture in the post? (Wordpress site)

    If they're contained within different divs, which I'd say they are, it certainly is possible using just CSS.

    .div1 img

    {
    display:none;
    }

    and do nothing for div 2


  • Registered Users, Registered Users 2 Posts: 1,632 ✭✭✭SuperWoody101


    cormee wrote: »
    If they're contained within different divs, which I'd say they are, it certainly is possible using just CSS.

    .div1 img

    {
    display:none;
    }

    and do nothing for div 2

    Thanks for that, but I'm not 100% sure what I do with that code, I just update the site with news posts etc...

    39e545b34778923d12940893b01798c5.jpg


  • Registered Users, Registered Users 2 Posts: 1,802 ✭✭✭cormee


    No, it would involve adding a few lines of code to your CSS files. If you're not sure how to do it I wouldn't risk it if I were you. You could do more bad than good.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 213 ✭✭Hoku


    Using the custom fields is probably your best bet. Just define a field with a name like "featured-image" and put the full URL as it's value.

    Then with a little PHP snippet, you check if a featured article has the custom image defined and if so, display it. Would make sense to have a fallback image in case there is no image defined.

    Wordpress Codex has detailed enough documentation about how to recall the custom fields from within the "Wordpress Loop".
    If you're not very comfortable with accessing and changing the theme files, find somebody who is - I'm sure there are plenty of people browsing this section who would be willing to assist you via PM (including myself).


  • Registered Users, Registered Users 2 Posts: 16,415 ✭✭✭✭Trojan


    Here's an example of using WordPress custom fields I wrote a while back, though as Hoku says, I think the OP may be uncomfortable hacking theme files.


Advertisement