- This topic is empty.
January 5, 2018 at 4:28 am #264932
I have a figure of how much we have done within a sector i.e. £200,000, this is displayed over an image for that sector.
I need this figure to automatically change once I’ve updated it somewhere (either backend or inline css) and everywhere that figure is displayed it will update to the new figure.
Basically to reduce the amount of time I have to manually update the figure everywhere it is referenced and reducing the likelihood of error with numbers not being the same.
I hope this makes sense and I really hope this can be done easily?January 5, 2018 at 7:27 am #264938
textContent) or, if your web page can run PHP, try a PHP
include()January 5, 2018 at 7:46 am #264941
Thank you BeverleyH,
You are a diamond!
Do you have any examples of how it’s done? I’m running a wordpress site with a custom theme.January 5, 2018 at 11:02 am #264951
Hit up Google for examples of what’s highlighted;
PHP include http://www.tizag.com/phpT/include.php
Totally forgot about pseudo elements in CSS https://css-tricks.com/almanac/selectors/a/after-and-before/
Try it in an inline style tag in the main header template file, or maybe you can edit the head section via a template editor via the admin panel. If it were to go in an external stylesheet, it will likely fall foul of the previously mentioned caching problem (like the .js file). Again, the text won’t exist in the web page’s document body (its CSS afterall), so it isn’t real content that a search engine can read, but if you’re happy to go with a visual only workaround, give it a whirl.February 11, 2018 at 7:09 am #265127
The pseudo element looks the best option on an initial test.
The WordPress theme has a backend section for custom CSS and Custom JS ideally all of the Sectors that the company works in i.e. Offices, Residential etc… will have a sector total… £200,000 this figure will change quarterly and will be displayed in a few places on the new website, so to keep consistency of figures having all the figures in one place that can be quickly edited it a huge time saver.
I think the CSS is the best route as i’m not worried about SEO for the figures.
Thank you again, I really appreciate it! :)
- The forum ‘CSS’ is closed to new topics and replies.