serve_site changes CSS to its default values in blogdown - css

I'm creating a blogdown website using agency theme and everything works fine.
I changed some stuff in the CSS, located in public/css/agency.css and I can see all changes. However, when I restarted RStudio all changes I've made switch to their default values (colors and stuff). And the same happens if I run blogdown::serve_site()
I can't see what's going wrong with my approach and any help would be appreciated.

Do not touch the public directory. It is automatically generated from your website source files (see Section 1.2 of the blogdown book for some basics). If you want to change anything on your website, always change the source. In your case, you can either change the CSS file in the theme (personally I don't recommend this way), or provide your own static/css/agency.css to override your theme's CSS. For more about the overriding mechanism, see Section 2.7.

Related

Blogdown: change CSS in the Academic theme

I am creating a blog with blogdown and the academic theme, which apparently is now available on the repo of Wowchemy. This repo doesn't have the same structure compared to the previous academic theme and I am a bit lost.
I would like to change some CSS components but I can't figure out how to do so. Here's what I tried so far.
Modify the .css and .scss files
I tried to modify the public/css/academic.css file and the resources/_gen/assets/scss/scss/main.scss_6c95cc1249b26b124274204dbf970c34.content file. In both cases, the changes are reset after blogdown::stop_server() and blogdown::serve_site().
This is also the case when I modify both of them before running the two blogdown functions.
Create a custom.css
As said in the Wowchemy documentation, I tried to put my changes in assets/scss/custom.css (I had to create the `scss folder as well), but apparently it does not influence the theme.
Question: How can I change some CSS parameters in the "new" Academic theme?

Will "Hello Elementor" automatically convert SCSS to CSS

I've just started using the WordPress page builder "Elementor" and have decided to move from "Genesis" to their own theme called "Hello Elementor". However, their theme uses SCSS and GruntJS.
On their documentation, they've included a custom.scss for all the custom styling. But when you add anything to this via WordPress, nothing happens. I know I could download the theme and use Visual Studio Code to make changes and use a sass compiler to automatically compile this for me, but it would require me to constantly upload files via FTP. Ideally, I would like to stay away from this.
Is there something I am missing? Or something I could do for WordPress to automatically compile this for me?
Edit:
If anyone has any recommendations of other themes to use with Elementor, I would really appreciate it.
They removed this option in Hello Elementor. You can no longer integrate custom scss. And I don't know since which version it's not present anymore, considering that I've tried the latest two ones and none of them seemed to accept the scss custom file.
However, you can check the answer they gave me a few days ago on the Hello Elementor GitHub page, if you want.
https://github.com/elementor/hello-theme/issues/85

Custom CSS WordPress Theme via cPanel (not updating)

I am wondering why I am not unable to make changes; I already tried several things yet, I don't seem to be able to update the CSS, the following I did already:
There is no Editor, so I am unable to make changes via there.
I am an Administrator and have access to cPanel.
I made changes via ../wp-content/theme/my-theme/style.css and no changes were made.
I empty my cache via plugin and hard reload my Chrome, Firefox and Safari. And no changes were made.
Is there any other solutions? I already found the file which contains all the styles. I would try to add my own class, and see if I am to see if there is any effect.
First thing first, From cPanel you can navigate to your website from the fileManager, use it to make code changes and then save them. You need to clear the cache everytime you make changes (i usually do it from the browser (in chrome, open the dev console, then long press on the refresh button and select the bottom one)
If the changes are still not showing on your site, I think that maybe you are editing the wrong CSS? Is this your theme and are you 100% sure you are editing the right file and, for example, it's not overwritten by a child theme or something else?
If you are using any framework, maybe your property is overwritten by your framework (for example, by bootstrap). To check this, open the console or try to add !important in your CSS file.
Just as an example, when I develop a theme I leave the root style.css with only the theme definitions, and then I create different stylesheets in a different folder. This leads me to the next question: are you enqueue your file correctly? is it even loaded by WordPress?
to check this I usually inspect the code in and search for the id of the file I enqueued from my functions.php.
Unfortunately, without more details, this is the only things I could think of when developing and WordPress theme and make changes from cPanel. Hope some of this can actually help.
Please check following options
Permission of file at ../wp-content/theme/my-theme/style.css.
Grab the css and open in Dream-viewer or sublime is there any css syntax issue.
Also the path of style.css in header is show same by view source.
Or
Even you can use the plugins which allow to add custom css without toching the server check this plugin https://wordpress.org/plugins/simple-custom-css/

Events manager - child theme not working

I am trying to make changes to plugins/events-manager/templates/forms/event/bookings.php via my child theme. When I make changes to the file directly in the plugin, it works well, but I know the way to go is to make changes at the child theme level so this is what i have done:
I added the edited bookings.php to twentytwelve-child/plugins/events-manager/templates/forms/event/bookings.php but for some reasons the changes are not applied.
I have also tried to add the edited bookings.php to twentytwelve-child/events-manager/templates/forms/event/bookings.php but it is not working either.
I would appreciate if someone could help me figure this out (screenshots below). FYI - I am not a developer, so please try not to be too technical in your answers.
Many thanks,
Yvan
It would be nice if developers could simply override a specific file within a plugin from within their theme, but I'm pretty sure WP doesn't work that way (At least not for overriding plugins. Theme files? Yes. Plugins? No).
If the plugin developer was nice they will have given you some override capabilities like using action hooks, filters, or including their function as static within a class.
From the looks of the events-manager plugin file there are three such action hooks available:
do_action('em_events_admin_bookings_header', $EM_Event);
do_action('em_event_edit_ticket_td', $EM_Ticket);
do_action('em_events_admin_bookings_footer', $EM_Event);
You will either need to hook into these actions to make your adjustments (highly recommended), or duplicate the plugin, rename it, and edit it manually (which means you will need to duplicate these edits every time you upgrade... YUCK!)
EDIT after further researching the events-manager plugin:
While WP doesn't provide this template override functionality, it looks like the plugin does. However after some digging in the documentation I noticed that this functionality doesn't specify weather it supports child themes. Try placing the template override within twentytwelve instead of twentytwelve-child. If that works, then maybe you could move that folder back into twentytwelve-child and create a symlink within twentytwelve to the real folder in twentytwelve-child (sort of tricking the plugin). Doing it this way means you have to recreate the symlink each time you update twentytwelve, but the trade off is that you can now override templates and won't loose your changes if you update twentytwelve (just the symlink).
The problem is your file path:
plugins/events-manager/templates/forms/event/bookings.php
should be
plugins/events-manager/forms/event/bookings.php
If you have issues with EM we monitor the free forums here (I stumbled on this by coincidence) - https://wordpress.org/support/plugin/events-manager
also #StevenLeimberg, thank for chipping in! we do support child themes it was just wrong directory structure.

django-pagedown seems to be overriding the default Django admin styling -- did I do something wrong with `collectstatic`?

I've just installed django-pagedown according to this post. I added in all the code and once I did a ./manage.py collectstatic, I noticed that when I navigated to any DetailPage in the admin (e.g. to add/edit an object), the styling changes.
For example, this is the styling of an object's ListPage:
And this is the "new" styling of an object's DetailPage (and where the AdminPagedownWidget is located):
The change is pretty subtle -- the font is different / slightly narrower. Of course, this isn't a huge deal, and I'm super stoked to have a live preview of my markdown content... but does anyone know why this is happening? I suspect it has to do with how Django's collectstatic works, and django-pagedown's CSS is overriding the default admin's CSS... but it feels to me that the base CSS of the admin pages shouldn't be altered, so maybe I've done something wrong when collecting static files. I already took a look at the options that collectstatic comes with, and tried it with the --clean option, but that didn't seem to solve anything. I looked at the source code and saw that the pagedown styles are indeed being loaded after the admin styles, but how would I go about changing that order in the admin interface?
There's a bug. The AdminPagedownWidget is also importing the css file for the normal PagedownWidget which means there are two css files being imported to your template; the former CSS file (demo.css) is imposing a font on the body tag.
I'm the django-pagedown author so I'll fix it now - well spotted!
Edit: If you reinstall/update it should be fixed now pip install django-pagedown=0.0.5

Resources