favicons, colors and other styling choices for a user

By: Shawn Fawcett | Asked: 08/18/2022
ForumsCategory: General questionsfavicons, colors and other styling choices for a user
Shawn Fawcett asked 2 years ago
I am building a back end for user to create their own landing pages. I would like to have a settings page/form where they can choose general styling.  In the form for the various choices I could have fields with their choices. That seems to be the simple part. eg Favicon field "add url in the field" Button colour field: "add color in the field"   For each landing page they create the landing page would use those styles. How would I go about this?
Bobby Clapp replied 2 years ago

There is a lot to this that is not known. For the favicon for example you could have a place holder coded into the landing page like <code><img src="[field_id_here]"></code>, but it depends on what that means to you. What happens if they load an image with a width of 1200px? Is that too big? Then you have to make that <code><img src="[field_id_here]" style="max-width:50px"></code> or create a class that will handle that and put that into a stylesheet somewhere. That's just the favicon. Similar questions come with each field and how you wish to handle things.

Shawn Fawcett replied 2 years ago

For the favicon example I am more looking on how I can change the site's existing favicon. If there was a shortcode or a little php function I could use to do that it would be ideal. The favicon would be a standard 16x16 pixels and replace th site's favicon for that page. https://www.w3schools.com/html/html_favicon.asp

Bobby Clapp replied 2 years ago

Like a different favicon per landing page or just the one time for the whole site?

Shawn Fawcett replied 2 years ago

Just per landing page. The site has a different one

Bobby Clapp replied 2 years ago

Read here:

https://wordpress.stackexchange.com/a/318279

and then that would likely need to grab the value of an entry by entry id with something like this:

FrmProEntriesController::get_field_value_shortcode(array('field_id' => x, 'entry' => $entry_id));

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right