The Jupiter Page Background Image Position can be a challenge with certain images. Sometimes the background image added behind your page winds up looking horribly cut off. So how can we improve the Jupiter Theme background images?
Background Color & Texture
Jupiter only allows for general background-position directions. This can be done per page using the Background Color & Texture settings’ Background position buttons.
There you can choose for 9 positions:
bottom center and
And this is a nice feature and is enough most of the time. But sometimes you simply need more control. And for that you need to add some nice CSS.
CSS Background Position
With CSS you can position the background image more fine grained with percentages or using a fixed amount of pixels. This allows you to position these images the way you want. Especially useful when you add portrait size images and need to make them fit and display well. You could make all these title background images taller to make things fit. But then at about 700px height they will take up too much space really. Visitors like images, but also need to be able to read text right away.
to the Visual Composer’s CSS for that page. This piece of CSS with your own choice of percentages for the background-position allows for you to tweak the background image position to your heart’s desire. I do hope we will be able to do this without CSS in the future with Jupiter but for now this seems to be the way to go.
We bumped into an PHP Strict standards: Declaration of A should be compatible with B issues.We had a theme made by us quite some time stop working recently. One we we were using as a demo mainly. So we decided to work things out. As many of you might bump into this I decided to jot this down.
Strict Coding Standards Warning
The warning we got was:
Declaration of THeaderContainer::OnEnableEvent($Sender, $Input) should be compatible with TControl::OnEnableEvent($Sender)
This is a strict coding standards warning. See comment searching this PHP.net page for declaration. The first argument does have two arguments, but the second does not. This could be fixed using:
with the extra argument $input added. This had to be done across like 35 files so I had to do a search and replace.
Additional Similar Declaration warning
The same had to be done with:
occurrences. This to deal with warnings like:
Warning: Declaration of THeaderContainer::OnEnableEvent($Sender, $Input) should be compatible with TControl::OnEnableEvent($Sender) in /../../../../../THeaderContainer.php on line 32
So just like with the previous warning we added the extra argument $input to make PHP in Strict Mode happy.
The main question remains though why this pops up now though. We had been running PHP 7.0 for quite some time already so been using a post PHP 5.4 version for quite some time to say the least. And we did see some errors from time to time, but now we could no longer login. What had changed is that we moved from a VPS to Dreamhost shared hosting so perhaps lack of memory spoiled the party.
Strict Mode needed?
You do of course not need to work with PHP Strict Mode and you can turn it off. This by changing php.ini, or a user.ini. or removing or adjusting mode declarations in other files. But as we had this project up and running with it since way back I decided to stick to this. And this way you do learn a lot about PHP and how to write it properly.
When you set up the Jupiter theme you will get a Jupiter Theme Memory Limit warning due to the standard WordPress site setup. Normally the WordPress memory usage is set at 40 MB, but you need 96MB minimum. So how can we remedy this issues?
WordPress Memory Limit
To fix this alter wp-config.php and add the following line:
Once you reload the Jupiter setup page again all should be fine. This unless the general PHP limit is very limited. In that case you will need a custom php.ini, change it in Cpanel, Plesk or DirectAdmin or ask your hoster.
Been working on getting WPLMS to run on Roots Trellis. It is for a new exciting startup project I have been working on. To quote WPLMS:
WPLMS is a Learning Management System for WordPress . It is suitable for Training Centres, Corporate trainings, Course tutors, College, Academy, University, School and MOOC platform. It is an e Learning WordPress theme for course management, instructor and student management using which you can create and sell your courses online.
Let me show you here you can get it all done smoothly on a Trellis LEMP / Bedrock setup. And with the avoiding of as many mistakes as possible. No need to make the same mistakes I made.
Initial WPML Setup Pains
Have run in quite a few issues. First issue was that importing the dummy data would not go smoothly. This due to quite a few issues, but here then main ones:
WP Importer interfering with the import and general errors. Had to deactivate it.
Many deprecated errors running on PHP 7 in the theme
Quite a few PHP Notices due to undefined indexes or variables. And when you run locally with XDebug turned on like you normally have in Trellis that is a huge pain.
Even after the latest update there were stil some eventOn plugin errors due to using class and function with the same name, but those I did solve.
Today I am going to do it all over again with the latest update. Let’s get started.
NB If you do a clean installation you do not need the next step.
Resetting the Local Setup
To reset the local setup and start all over again without loosing the general setup nor plugins and themes I use the plugin called WordPress Database Reset . Awesome plugin recommended by Arul at Smartpixels. I added it to the composer.json file using this line:
After that I ran a composer update to update the site plugins and themes in the composer file and to get the WordPress Database Reset plugin:
Once you installed it you can use it to reset all database tables and restart without the WPLMS theme so you can start anew like you would with a clean installation.
Raising PHP Memory Limit in Trellis
This update should have attended to all these PHP errors and will make debugging a lot easier again. I also raised the memory in trellis/roles/php/main.yml to 128:
If you don’t it won’t be possibly to install the theme smoothly due to the many components it uses.
Then I removed the theme using:
rm -rf wplms/
NB The installation of most plugins can wait as the theme will ask you for it later on. And this is also recommended by WPLMS. Only if I did not activate the dummy data plugin I could not install with it.
I did add all the necessary plugins and activated them before activating the theme. This as I had them installed before during initial failed attempts. Do not forget to update them when need be! You will see that one plugin eventOn still has errors in file
But that error you can fix by renaming the functions in question to
Especially the dummy data plugin needs to be active. Otherwise the Theme setup installer will not offer to set up the theme with dummy content. I picked dummy data 2 and installed this plugin.
Plugins in use
Here is a list of plugins I have installed minus WP Job Manager I added later on. The latter is for this project specifically so you do not need it nor every plugin listed here. BackupBuddy is great for backups for example, but not recommended for WPLMS.
BuddyPress does seem to have issues with WPLMS still as I see these errors after I installed all the plugins including BuddyPress
( ! ) Notice: Trying to get property of non-object in /srv/www/domain.com/current/web/app/plugins/vibe-course-module/includes/bp-course-activity.php on line 193
( ! ) Notice: Trying to get property of non-object in /srv/www/trainerolo.com/current/web/app/plugins/vibe-course-module/includes/bp-course-activity.php on line 199
( ! ) Warning: Cannot modify header information - headers already sent by (output started at /srv/www/domain.com/current/web/app/plugins/vibe-course-module/includes/bp-course-activity.php:193) in /srv/www/domain.com/current/web/wp/wp-includes/pluggable.php on line 1174
So I initially deactivated it as you will see a little later on.
Uploading the plugin zip file from appearance > themes with the zipped file had issues too. I got this NGINX error:
413 Request Entity Too Large
Cybercity explains here how you can fix this NGINX limitation. The NGINX config files are Trellis / Ansible managed though so would be could to change the roles, not the config files manually. What I did in the end was simply unzip and add to the themes folder. In your case it should perhaps run just fine and then you can move on and see what I saw in the next step
After uploading the theme folder with all its content it installed just fine. I got to see:
Awesome! After that I was able to install all without issues. Meaning the sample data did get installed this way as well. This did take quite some time though. So do not interfere or freak out because it does not get all done in 10 seconds.
Afterwards you will be asked to make sure your permalinks are correct and that the BP Core Components are installed properly.
BP Core Components Missing
When I went back to the dashboard I did see these errors:
WordPress database error: [Table 'domain_com_development.wp_bp_messages_recipients' doesn't exist]
SELECT SUM(unread_count) FROM wp_bp_messages_recipients WHERE user_id = 1 AND is_deleted = 0 AND sender_only = 0
WordPress database error: [Table 'domain_com_development.wp_bp_friends' doesn't exist]
SELECT initiator_user_id FROM wp_bp_friends WHERE friend_user_id = 1 AND is_confirmed = 0
This was because the core BP Components were not installed properly yet. The WPLMS installer will ask you to save permalinks and to save the components. It will ask this once the dummy data and theme in general has been installed. Once that is done all is fine and errors will have disappeared.
Revolution Slider Issues
Still after that the homepage looked horrible and I missed the slideshows. When I checked Slider Revolution I saw that I had 4 sliders of which 2 were duplicates. Also the background image for the homepage search slide would not load. By selecting the same dummy image again I was able to bring it back.
Quite a few pages were imported several times somehow. So had to remove quite a few like the Activate or Members page. That shouldn’t really happen now should it? Well, not too hard to take care of this issue though. Just go to the pages list and remove all the duplicates.
Broken Header Due to Old Plugins
Also had an issue with a menu showing up below the main header. List a non styled menu on a white background.
And the header loading the most popular course somehow:
Simply logging out did not hide this type of header so it was not simply a logged in view. I found out later on this was due to me not having updated the plugins that come with the theme. Read my warning above.
NB Most of you will not have had this error either though as you would have the latest plugins of the bat. You will wind up having the pesky notices with the EventOn plugin for which I mentioned a solution earlier
End result will be a site that is using the dummy data you picked. I picked dummy data 2 and installed the plugin for that. But here are other options. Now you have a great base for your WP Learning Management System.
Main take aways:
Make sure you have enough RAM for PHP available
Use the latest theme package
Install and activate a dummy theme data plugin before activating and configuring theme