PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Sep 23, 2018 7:49 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Mar 15, 2018 5:14 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
We have this kind of code to set the background colours of a Post in a Wordpress Blog.
But we want to make it easy to add more as they add more posts. But without adding all the other elements.
ie.

.postid-1315, .postid-4353...

So once they add a new post, I can pop in and just add another postid into the mix. but how?

Syntax: [ Download ] [ Hide ]

.postid-35126 #grve-main-content .grve-main-content-wrapper
{
 background-color: #000000;
}

.postid-35126 #grve-main-content .grve-main-content-wrapper a:hover
{
   color: #e8e8e8;
}

.postid-35126 #grve-single-post-meta-bar
{
 background-color: #000000;
display: none;
}

.postid-35126 #grve-post-breadcrumbs
{
background-color: #000000;
border-bottom: 1px solid #333333;
border-top: 1px solid #333333;
}

.postid-35126 #grve-post-breadcrumbs a:hover
{
color: #ffffff;
}


.postid-1315 #grve-main-content .grve-main-content-wrapper
{
 background-color: #000000;
}

.postid-1315 #grve-main-content .grve-main-content-wrapper a:hover
{
   color: #e8e8e8;
}

.postid-1315 #grve-single-post-meta-bar
{
 background-color: #000000;
display: none;
}

.postid-1315 #grve-post-breadcrumbs
{
background-color: #000000;
border-bottom: 1px solid #333333;
border-top: 1px solid #333333;
}

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2018 5:53 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Is there no common class you can use? If not, can you add one? What does the associated markup look like?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Thu Mar 15, 2018 5:59 pm 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
Those class 'numbers' are part of the <body> tag.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2018 9:47 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13576
Location: New York, NY, US
simonmlewis wrote:
We have this kind of code to set the background colours of a Post in a Wordpress Blog.
But we want to make it easy to add more as they add more posts. But without adding all the other elements.

If they can set specific CSS settings on an individual post basis, why not just save the styles in the DB with the post and generate a style="<?= $post['styles']; ?>" for each post?

_________________
(#10850)


Top
 Profile  
 
PostPosted: Fri Mar 16, 2018 2:48 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
Sorry?
Bear in mind this is to make it easier for me to add the css, as the person posting it cannot do this.

I want to be able to go into the CSS file in Wordpress and just add that one line of postid.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group