• Resolved newroman

    (@newroman)


    Hello!
    I am a bit confused on this topic: I tried to read documentation online but I need to ask some questions, and I hope you can help me.

    I have a simple website with Astra theme, a few pages created with Elementor.
    I would like to add one more page created with HTML and CSS (and maybe very basic JavaScript).

    Is it possible to create a custom code page in a website that is using a theme?
    How does it work?

    Should I use the wordpress page code editor for the HTML – and how do I link the CSS? Should be in-line CSS only or there is a way to link a css file?
    I am actually using a free hosting, and I have a limited access to the server, so I hope there is a solution to do this from WordPress – but interested in understanding how it works also on the server side.

    This is actually for educational purposes – and I am also wandering: is this using wordpress as a headless CMS? Can you split the front-end?

    Thank you in advance for your help

Viewing 6 replies - 1 through 6 (of 6 total)
  • You usually provide your own templates via a child theme. More about child themes can be found here:
    https://developer.www.ads-software.com/themes/advanced-topics/child-themes/

    The theme you use, Astra, even has a generator for this: https://wpastra.com/child-theme-generator/ – if you have any questions, please ask there.

    With a child theme you can provide your own templates as well as add your own CSS code. In the 1st link above is all actually described.

    Moderator bcworkz

    (@bcworkz)

    If limited access means no FTP access, I find that restriction troubling. If errant code crashes the site you have little recourse to recover for yourself.

    It is possible to create a child theme and install it without FTP access by putting it all in a .zip file and using the Upload Theme button on the Add Theme admin screen. Ideally the child theme would be tested on a local WP installation to ensure it is 100% error free before trying to install it on a limited access server.

    If an uploaded theme would cause any errors on activation, WP should refuse to activate it. I don’t think the WP error handler is bomb proof though, so prior testing is still a really good idea.

    Thread Starter newroman

    (@newroman)

    Thank you both for your replies!
    A child theme is an interesting option and I am reading to learn more about it – thanks for the docs, and for warning me about the risks.

    Just one more question on this: will I be able to apply the new style to just one single page, or it will apply to all the website, just overriding parent theme?

    You can also make an adjustment to only one page. There are several ways to do this as well. For example, you could add a new template and assign it to this page only. If it is only about style adjustments, you can also solve this via CSS – in many themes, a page-specific class is added to the body element, which you can use to apply the adjustment only there. For the latter you theoretically don’t even need a child theme.

    Thread Starter newroman

    (@newroman)

    Ok! Yes, this is only about style.
    Then it would work like this:
    – code editor in Gutenberg for html
    – custom css applied with page-specific class as described here https://wpastra.com/docs/how-to-add-custom-css-for-specific-pages/

    Thanks again! It was super useful

    Moderator bcworkz

    (@bcworkz)

    If your theme alterations are strictly CSS, as threadi said, you don’t even need a child theme. Some theme’s have a specific file on which you can add custom CSS by using the theme editor. However, for any theme subject to periodic updates, do not directly edit its style.css or any other theme file not intended for site admin editing. Instead, you can place your custom CSS in the customizer’s Additional CSS section.

    The Additional CSS section is hidden by default with some FSE themes, but it can be exposed again with a very simple plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom code page’ is closed to new replies.