WordPress function: Add CSS based on url

If you want to add CSS to a compared page or category-taxonomy etc, here’s a quick way:


// Function to apply css on specific page url by NicolasLagios.com
add_action( 'init', 'css_me_bash_to_url_by_Nicolas' );
function css_me_bash_to_url_by_Nicolas() {

$url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

if ( false !== strpos( $url, 'string' ) ) { //here we change the string as we want, eg for mysite.com/site/something/somethingelse.html , we put the word "something"
echo '<code class="php plain"><style type=</code><code class="php string">"text/css"</code><code class="php plain">></code> /*here we write css code*/ </style>'; } }  
  1. We change the string
  2. We write the css
  3. We put the function in the child theme or in the my custom functions plugin

If you need help

Original Source: https://nicolaslagios.com/wordpress-%cf%83%cf%85%ce%bd%ce%ac%cf%81%cf%84%ce%b7%cf%83%ce%b7-%cf%80%cf%81%ce%bf%cf%83%ce%b8%ce%ae%ce%ba%ce%b7-css-%ce%bc%ce%b5-%ce%b2%ce%ac%cf%83%ce%b7-%cf%84%ce%bf-url/

Σχολιασμός μέσω Facebook

Leave a Reply

Your email address will not be published.


Digital Marketing

The Digital Marketing services will be ready soon

You can already see and order (online or via communication) our services in the “Additional Website Services” by clicking here.

Work

Explanation

Terms

Fixed costs (per month or year for services etc.)

Registration of desired domain

It is the address of your site, eg: tositemou.com

If you already have your own domain, we will proceed directly to the its connection to the hosting area.

Fixed domain costs are not related to our service and are not included in the offer you will receive, you pay directly to the provider and receive a separate invoice from them.

From €10 / year to €30 / two years (depending on the ending gr, com etc.)

Website hosting setup

It is the space that hosts your files

If you already have one, we set up the existing one, without being responsible for future problems on your site and extra charge for damages due to upgrades or servers.

If you wish, you can purchase our annual "Maintenance+Hospitality" package for €190 / year without being charged for any damages due to upgrades.

Max Services Support & VPS Hosting + Unlimited Subdomains & email accounts (total 25GB HDD space): €20/month, €110/6 months, €190/year.

Platform Installation & Setup (Wordpress, Joomla, Drupal, Opencart etc)

It is your website software

Setup of the website with the basic information of the business, as well as any necessary technical setup

Theme installation & configuration

Skeleton/Theme/Template


It is a ready-made template that we customize to suit you.

If you wish to build a Custom theme (completely from 0), the final price of building the site will be discussed.

Construction / Posting of website content

It concerns static pages (contact, company etc) + material upload (products - articles)

Up to 50 manually.

Up to 2000 in bulk (as long as you have given them tο us in excel).

For more, the final price will be discussed.

Add terms of use, privacy policy and GDPR bar

It is 100% legally necessary to post on special pages that will be included in the bottom menu of your site, the terms of use and the privacy policy of your website, as well as a special pop-up bar that appears to new visitors where they will have to accept its cookies your website.


Especially in Europe, the GDPR law obliges you to take these actions as it concerns the personal data of each visitor.

You can choose to add terms and policy copy from similar sites (changing names and addresses of course) or choose to send us the content yourself and post it.

But you should know that under no circumstances do we bear any legal or other responsibility for the content.

Eshop mechanism (if desired)

Mechanism installation & adjustment

· Setting up business details (transportation, payments, VAT, etc.)

· Shop design etc.

· Wholesale or Dropship sales if desired

To import products, you need to have your product data ready (code, stock, title, photo, etc.).


We import: Up to 50 manually.

Up to 2000 in bulk (as long as you have given them to us in excel).

For more, the final price will be discussed.

Επιλέξτε Υπηρεσία Διαδικτύου

The services through the website are coming soon!

The services concern the service office in Makrakomi, Fthiotida with service for all of Greece.

At the moment you can call the phones: +30 223 602 4107 & +30 698 630 7660

You can also send an email to: max.makrakomi@gmail.com

Few of our services

Σύντομα κοντά σας!

Skip to content