Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS can i place text in a div via css sheet?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27038
    mikeman
    Member

    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

    #76795
    TheDoc
    Member

    You can do that with a PHP include.

    #76798
    Johnnyb
    Member

    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

    #76748
    Johnnyb
    Member

    Any changes made to that header php file will show across all of those pages.

    #76722
    TheDoc
    Member

    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.

    #76517
    TheDoc
    Member

    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.

    #76508
    TheDoc
    Member

    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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.