Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-02-24 17:57:09

murnau
Member
From: Lower Saxony, Germany
Registered: 2022-10-23
Posts: 11

Add custom.css to website -path?

I wanted to add a custom.css to my website, using the following path in the page seems not to work…

<link rel="stylesheet" href="<txp:site_url />themes/four-point-eight/styles/custom.css" />

Last edited by murnau (2023-02-24 18:03:26)

Offline

#2 2023-02-24 23:56:12

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

Re: Add custom.css to website -path?

murnau wrote #334747:

I wanted to add a custom.css to my website, using the following path in the page seems not to work…

<link rel="stylesheet" href="<txp:site_url />themes/four-point-eight/styles/custom.css" />...

i use this approach
<link rel='stylesheet' id='style-css' href='https://mysite.com/assets/css/style.css' type='text/css' media='all' />..


…. texted postive

Offline

#3 2023-02-25 01:11:41

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

Re: Add custom.css to website -path?

murnau wrote #334747:

I wanted to add a custom.css to my website, using the following path in the page seems not to work…

<link rel="stylesheet" href="<txp:site_url />themes/four-point-eight/styles/custom.css" />...

Did you first export the theme to the file system?

From the Theme panel, select the theme (checkbox) and then from the select widget below, select export. Your whole collection of templates: pages, forms and styles will then be available on the file system, in the /themes folder/directory.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2023-02-25 09:32:44

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

Re: Add custom.css to website -path?

PS, I realise now, maybe you mean that to you added a custom.css on the Styles Panel.

Using the <txp:css /> tag you can reference it in your templates (documentation).

<txp:css format="link" name="custom.css" />

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#5 2023-02-27 07:25:20

murnau
Member
From: Lower Saxony, Germany
Registered: 2022-10-23
Posts: 11

Re: Add custom.css to website -path?

Thank you for your help!
The solution works!
In the ‘theme-panel’ I had to export the theme first.
Then adding the custom.css path to the page:

<link rel="stylesheet" id="style-css" href="<txp:site_url />themes/four-point-eight/styles/custom.css" />

Last edited by murnau (2023-02-27 07:28:30)

Offline

Board footer

Powered by FluxBB