Wordpress - Remove dynamically generated style sheet? - php

I made a wordpress site and it has an error in which a "dynamically generated style sheet" creates this style:
content {width: 0px;}
This causes all of my content to squish to the left. http://wp.townsendsites.com
Is there a way to get rid of this, or override it in either the php or css?

If you want to overwrite a markup that cannot be overwritten, use: width: 80% !important;
it's not the best practice, but it works. 80% is an example.

A neater way to solve the problem isn't to try and override the styles; it's to work out why those styles are there in the first place.
I've had a very quick poke around the theme and I can see that the dynamic stylesheet is generating its styles based on theme settings; the theme should have an extra options screen in the admin area where you can enter your own width for content.
Failing that you can comment out line 619 from 'functions.php' which currently reads "add_action( 'wp_enqueue_scripts', 'bitLumen_enqueue_dynamic', 10 );"
That's the line that loads up the dynamic stylesheet
I'd recommend you try and find the settings in the admin area first; no sense trying to brute force your styles with !important rules

Related

Inline css for making a wordpress theme

I am creating a wordpress theme and all the css is working fine. However I implemented a bootstrap jumbotron slider where basically I have 3 divs and each div has an inline style in the index.php file with it's own background image.However, my wordpress theme does not recognize any styles that I implement straight into index.php
Any solutions or work arounds?
WordPress by default strips out any code that may be considered "code" or malicious. Yet, there are ways to add inline code to a WordPress without WordPress Plugins to overwrite the default functionality of WordPress. For example, As you didn't provided any code, so here is just an example.
<h2>Header</h2>
Here is how you can do it with inline css
<h2 style="color:red;">Header</h2>
The issue with Inline CSS is it’s really only used for one-off occasions! You would never really use this to apply a consistent feel across all your pages.
P.S This is most important, don't forget to include your bootstrap.min.css file in your wordpress function.php

Wordpress. Making article items bigger

I am new to WP don't know how does the theme customization work. I've chosen receptar theme (link)
I want to make the article items on the main page bigger by default, as I would do with Ctrl +. How Can I do it?
I want to change it from this :
to this:
Word of caution: always try to fix things yourself and let us know what you've tried before asking on SO. Everyone here is happy to help once you hit a roadblock.
Now, to fix the issue you need to modify the Width of the element. I changed it from 50% to 100%. When it is 50% it allows two items to be next to each other, so if it is 100% every item will take all the space it can, getting to what you're looking for.
You can copy and paste this code into your theme CSS styler:
.posts .hentry {
width: 100%;
}
Usually, all themes come with this, or if your version of Wordpress is 4.7+ you can do this through the customizer.
That should do the trick.
You can easily do this with CSS,
please go to your theme main style.css and add this CSS
.post {
width: 100% !important;
}

wordpress remove scroll bar from a specific page

I need to remove vertical scrollbars from a specific webpage only in my site
http://historyofliverpool.com/test-2/
The page is made up from many php and css files, to I do not know where to begin editing, and do not want to alter the rest of the site.
Would a custom field on this page only solve my problem?
Any help much appreciated.
I can't find any overflow: hidden in your stylesheet.
Please try this:
.fullscreen {
overflow: hidden;
}
Removing the scroll bar is easy; you would simply need to apply overflow:hidden to the body selector.
The real challenge is removing the scroll bar on the correct page. There are quick and dirty ways of doing this, but lets take our time and look at this sensibly:
Child Themes
It looks like you're using the Anglepane theme. As this is a commercial theme I'd recommend you first create a child theme before making any changes. This way when the Anglepane theme is updated it doesn't remove your edits.
Identifying the page - body_class()
The next step is identifying and selecting the page you want your changes to apply to. WordPress has the convenient body_class() function that adds CSS classes to the body element, allowing you to easily add styles on a page by page basis. Now it looks like your theme isn't using this function; so you should add this function by:
Copy the header.php file from the parent theme folder to your child theme folder so you can edit it
Find the body tag and alter it like so:
<body <?php body_class( $class ); ?>>
Identifying the page - ID vs template
Once you've added the body_class() function you should find that your body element will have a bunch of classes that you can use; one of these will be the page ID, prefixed with .page-id-. You can now use that class name for your CSS. For example, if your target page had an ID of 3 you could use:
.page-id-3 {
overflow:hidden;
}
While this works, I personally like to use page templates instead for targeting page-specific styles. One of the benefits to this is that it avoids mismatched page IDs between different environments. For example, I might want to change the background colour of my about page, which has an id of 4:
.page-id-4 {
background:red; // Works as long as the page ID is definitely 4
}
That works great on my local copy of the site, but on the live site my about page has an id of 24. I avoid this by creating a page template specifically for my about page. This way I can use the page-template selector instead, which is consistent across both environments:
.page-template-about {
background:red; // Now I work everywhere
}
Hopefully that convers everything in sufficiently detail for you.

How to introduce CSS rules in Tumblr environment without affecting the theme?

I needed few simple changes to the style sheet files and I successfully managed to make these changes offline through Google Chrome Inspector but when I tried every time to implement these changes on the Tumblr theme, the blog breaks down and becomes a big mess.
Can you guys tell me please how to tackle this issue? What's the right approach or the appropriate workflow to introduce such changes of this nature without disrupting the theme?
Thanks in advance for your time and cooperation.
Tumblr themes should have the ability to insert Custom CSS.
When inside your 'Customize Theme' panel, open the 'Advanced' tab (at the bottom), there will be a box that will allow you to add Custom CSS. Add the changes you'd like to make there.
If you don't see the changes, your theme might not be optimized to accept the custom CSS that you've entered.
Click on the 'Edit HTML' button and search for {CustomCSS}. If you can't find it, then you'll need to add the following code before the </head> tag.
<style type="text/css">
{CustomCSS}
</style>
That should do it!

Edit elements of the RIGHT NOW dashboard in Wordpress Admin

I'm customizing the Wordpress Admin site to suite my needs and there are several things I want to remove and customize (menus, etc...).
I noticed on the DashBoard section called 'Right Now' there are several things I don't need there. For instance the CHANGE THEME button and the wordpress version and theme. I found in the source dashboard.php where these are rendered, but rather than edit the source, can I just make a function that intercepts and changes this so it doesn't render them?
I also want to remove the DISCUSSION section and some of the counts for CATEGORIES, TAGS, and PAGES.
Is there a way to go about this? Thank you!
Hmm I think I solved this myself, although I'm not sure correctly. Using firebug I was able to find the class names and element ID's of the version and CHANGE THEME button and the version and theme
I added this code in my functions.php:
function wpc_remove_admin_elements() {
echo '<style type="text/css">
.versions p {display:none !important;}
.versions #wp-version-message {display:none !important;}
</style>';
}
add_action('admin_head', 'wpc_remove_admin_elements');
This added some styling in my header to hide these elements.
Is there a more efficient way to do this or am I going to be ok? I still don't know how to hide some of the Content and Discussion counts in the RightNow dash.

Categories