- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
using css i place a background image in a div, i can change the url to the image and it spreads through out all pages on my wordpress of that div class. could i do the same thing with text? id like to put the text in through css, then i can change it one time, and all of my posts with that class will change the text..
thanks
You can do that with a PHP include.
Technically you can add text using CSS by using ‘content:’ but php includes would be a way better way of doing it, especially as you’re already using wordpress which is php based. Includes allow you to have a separate file for your header/navigation for example which you can then include in any page you’d like. An
Any changes made to that header php file will show across all of those pages.
Put that wherever you want the div to appear, then create a file called “divtext.html” or whatever you like and put the code that you want to show in there. Then when you change that file, it will be updated on all of the pages that you are including it on.
You aren’t using a PHP include properly, it should look exactly like this:
I’m not sure why you’re trying to add HTML tags in the include.
Perhaps I don’t understand exactly what you’re trying to accomplish.
You also have to make sure the page that you’re working on allows the use of PHP.
More info: http://w3schools.com/PHP/php_includes.asp