aatanasov
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Logo not displaying properly on mobileHi, @mwebsterm,
Logo file issue
There are 4 image tags that show based on the screen resolution.
Here is a screenshot: https://snipboard.io/zJNDiu.jpg
For example, the image with this class
logo-mobile
shows on mobile. However, thelogo-main
image shows on desktop.All of these tags use this file https://mooreattuned.com/wp-content/uploads/2021/09/3.png — you can see that the attachment itself has a lot of empty space around the actual logo.
You can crop the file so only the logo graphic is part of it without any spacing around it and then use the modified file for the 4 image tags.
That way, the logo won’t be too small.
Size changing issue
for a very brief moment when I refresh the page it’s a good size
This happens because there is JavaScript code that sets a max-height to the logo after website loading (
style="max-height: 130.281px;"
). It isn’t clear why this approach was used.Using another approach will probably require recoding the logo section or using important styles.
Fixing the actual logo file might be sufficient, and the current sizing approach can be kept.
- This reply was modified 2 years, 5 months ago by aatanasov.
Forum: Fixing WordPress
In reply to: I got an error Amp is InvalidHi @hamarasujhav,
Would you be able to share the URL of the website so we can take a look?
Forum: Fixing WordPress
In reply to: cannot access wp-admin anymoreGreat, here is how you can migrate the WordPress site to the live domain.
- Make a full backup of your web folder (including the current live site and the WordPress instance) and database. This will help you revert the current live site quickly in case something goes wrong.
- Create a folder called
old
. When the new website is live, you can remove this folder or move it outside the web folder. - Move the current live website’s files to the
old
folder. - Move the files from the
wordpress
folder to the root directory of your website (https://www.spotview.nl). - Open the
wp-config.php
file and define the URL of the site as explained on https://www.ads-software.com/support/article/changing-the-site-url/#edit-wp-config-php — use https://www.spotview.nl (without a trailing slash at the end). - Once that is done, try to access the WordPress dashboard using https://www.spotview.nl/wp-admin/
- Refresh the permalinks (just opening the
Settings -> Permalinks
page automatically refreshes the permalinks behind the scenes). - Install https://www.ads-software.com/plugins/better-search-replace/
- Replace
https://www.spotview.nl/wordpress
withhttps://www.spotview.nl
by following the Better Search Replace plugin’s instructions — this will fix all site’s links added to editors/custom fields. Please note the URLs mustn’t use a trailing slash at the end. The plugin’sRun as dry run
option is helpful for testing the replacement before executing it. Replace only tables that use the prefix inside thewp-config.php
file. - Once that is done, review the front-end for any issues and the browser console for any 404 requests.
- Finally, run the Site Check tool and make sure the website is public for search engines (
Settings -> Reading -> Search engine visibility
).
If something wrong happens, please revert the backup and let us know to assist further.
Forum: Fixing WordPress
In reply to: Debugging PHP Fatal ErrorHi @wlpdrpat,
Since
get_post_meta
requires a number as a first parameter and the function itself validates the ID, you can simply replace this line:$custompoststyles = get_post_meta(mysqli_real_escape_string($_GET['postid']), '_custom_css', true);
with this one:
$custompoststyles = get_post_meta(intval($_GET['postid']), '_custom_css', true);
It will escape the unnecessary symbols before passing the
postID
toget_post_meta
. More about the used function can be found on https://www.php.net/manual/en/function.intval.phpForum: Fixing WordPress
In reply to: cannot access wp-admin anymoreGreat, the website loads now, but I can see the permalinks aren’t configured correctly because the interior pages don’t load.
Before starting the migration process, please refresh the permalinks from
WP Admin -> Settings -> Permalinks
(https://www.spotview.nl/wordpress/wp-admin/options-permalink.php
).You can also perform a Site Health check using https://www.ads-software.com/plugins/health-check/.
The idea is to ensure everything works as expected before going live.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionGreat, I’ve reviewed the printed code, and it looks good.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionGreat, we’re very close indeed. No printed code is necessary for the time being.
It looks like there is duplicated code.
Please remove these code lines:
update_option('x_invite_display',stripcslashes($_POST['invite_display'])); update_option('x_invite',stripcslashes($_POST['invite']));
The other code has the necessary validation before updating the 2 options.
After that, these options must be tested on the back-end and the front-end.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionAfter further debugging, something else prevents the data from being saved correctly (not the code snippet). However, please apply the latest snippet to fix the first error (
Uncaught TypeError: stripcslashes
).After that, we’ll need to investigate further what happens with the data on the options page.
Please add this code:
print_r( $x_maincont_details );
before:update_option('x_main_content',$x_maincont_details);
Also, please add:
print_r( $x_maincont_opt );
after:$x_maincont_opt = get_option('x_main_content');
This will tell us how the data looks before the option is updated in the database and how the data looks after retrieving the option from the database.
Please send the printed output and the form code from your previous message using https://pastebin.com/ or a similar tool because the code is too long.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionThere was an incorrect function used in my code snippet.
Please use this instead:
if( is_array( $_POST[ $optkey ] ) ) { $x_maincont_details[ $key ] = $_POST[ $optkey ]; } else { $x_maincont_details[ $key ] = stripcslashes( $_POST[ $optkey ] ); }
and let us know if it works.
If you have a database backup, please revert it to make the previous content available.
- This reply was modified 2 years, 5 months ago by aatanasov.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionThanks, please follow the below steps.
1. Remove the test code I sent.
2. Change:
$x_maincont_details[$key] = stripcslashes($_POST[$optkey]);
to:
if( array( $_POST[ $optkey ] ) ) { $x_maincont_details[ $key ] = $_POST[ $optkey ]; } else { $x_maincont_details[ $key ] = stripcslashes( $_POST[ $optkey ] ); }
Not the cleanest way, but I’d like to avoid refactoring everything.
Doing that, there might be an issue with the checkbox options (which will need to be tested) because arrays will probably be serialized into the database (it isn’t clear how the theme works with array options).
3. Test the page if there are any errors.
4. Test whether the text options such as
main_text
work after saving the options page.5. Test if there are any issues with options that have checkboxes, multiselects, and selects after saving the options page.
After that, please let us know what has happened.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionThanks, more information will be needed.
Can you please add
print_r( $optkey );
beforeprint_r( $_POST[$optkey] );
? I’d like to see which these options are.After that, if you can provide the actual data that is added to these
$optkeys
on the options page that would be great.Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionI see, please remove the
exit();
line, so all the code is executed until the error message appears.That means, only keep
print_r( $_POST[$optkey] );
from the 2 lines I sent in my previous message.Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionI’ve just noticed that you edited your message, and thank you for sending the error. It looks like an easy fix, but let us first debug the issue.
Can you please add these code lines:
print_r( $_POST[$optkey] ); exit();
before:
$x_maincont_details[$key] = stripcslashes($_POST[$optkey]);
After that, please test saving the page again and provide the information printed from
$_POST[$optkey]
.Forum: Fixing WordPress
In reply to: Theme Options Page Form Field QuestionGreat, you’re welcome!
Please feel free to mark this topic as resolved.
Forum: Fixing WordPress
In reply to: Theme Options Page Form Field Question@wlpdrpat, thank you for providing the video. It is helpful.
Please remove this code:
wp_editor( "" , "main_text", array());
from the
x_theme_admin_styles
function.I’m not sure why this code exists, but it isn’t required.
Removing this code will fix the styling issue on the options admin page. (I’ve tested it locally to reproduce the issue.)
Also, it would probably fix the issue with the other editors, but please let us know how the editors work after removing the unnecessary code line.
- This reply was modified 2 years, 5 months ago by aatanasov.