Code Monkey home page Code Monkey logo

Comments (6)

jjeaton avatar jjeaton commented on June 25, 2024

I completely agree with that.

I was about to open an issue to ask to have the fallback image loaded last, as this line reverses the array and it gets output first, which seems to result in it getting chosen more often than the other images.

I would suggest two changes:

  • Don't load the fallback image if there's a featured image
  • Output the fallback image at the end of the list of images, if there isn't a featured image.

Happy to submit a PR if it would help.

from wpfbogp.

chuckreynolds avatar chuckreynolds commented on June 25, 2024

@jjeaton make sure you're looking at the develop branch. That's where all the new stuff is. Beta 2 is the official last tag but I've got a lot of stuff in there since. So.. look there.
That array is currently fixed but re: this topic... thinking about taking the fallback out if a featured is found.

This also means I need to fix the featured issue I found and listed in #53

Technically it all works and nobody's ever complained but I could try and push that into this next main release or do it as a .1 after the fact. I'd really like to get this puppy out this weekend if I can. 👍

from wpfbogp.

chuckreynolds avatar chuckreynolds commented on June 25, 2024

Okay bear with me here. Sketched this out on my mirror (whiteboard alternative ;) Need to talk it through and add in proper wp code after.

NEW FLOW

IF forcefallbackimage checkbox is TRUE && fallback image is not empty {
-- echo meta og:image with fallback image url.
done.
ELSEIF is a post, page, or page_for_posts (blog run by a page in settings) && thumbnails are enabled && it has a thumbnail
-- echo meta og:image with featured image url.
done.
ELSEIF { 
  IF is post, page, or frontpage with page_on_front {
    -- run through the content and add to array
  } IF fallback image is not empty {
    -- add fallback image to bottom of array
  }
  test array and output the image array to meta og:image tag(s).
  else after all that shit - nothing is there then output <!-- no images found bro --> warning.
}

WHEW.....
sound good?? cc @jjeaton
I need a beer

from wpfbogp.

chuckreynolds avatar chuckreynolds commented on June 25, 2024

first stab at this rewrite. more to go. in branch feature/images-overhaul line 160.
25f8fa1#diff-c8cc0644f3623183b121b88dde0bae39R259

from wpfbogp.

jjeaton avatar jjeaton commented on June 25, 2024

Your logic here looks sound to me.

from wpfbogp.

chuckreynolds avatar chuckreynolds commented on June 25, 2024

2.3.0-beta.3 has it all inclusive. feel free to test: https://github.com/chuckreynolds/WPFBOGP/releases/tag/2.3.0-beta.3

from wpfbogp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.