Christopher Leah
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Hello, I need help with wp-admin pageHey @ayanwow,
To rule out themes and plugins, do you use the WP CLI at all on your site’s server?
If you so you can simply run
wp theme activate twentyseventeen
– if TwentySeveteen is installed then it will activate that theme and then you can re-try your site in a new incognito window. If the redirects disappear, it is likely related to the theme. If not you can do something similar for the plugins, and try runningwp plugins deactivate --all
this will deactivate all plugins and you can re-try visiting your site in a brand new incognito window again.Alternatively, if you do not have access to WP CLI, you could manually access your sites
wp-content/plugins
folder via FTP or a file manager, and forcefully deactivate them by simply renaming all the plugins in the folder with say a1
appended to the existing name.Once done re-try loading your site in a brand new incognito window.
These are the first steps I always suggest in these cases as its often a plugin or theme, attempting to redirect and forcing an endless loop, as it differs to the home_url WordPress was set to use.
Let us know how you get on ??
- This reply was modified 6 years, 4 months ago by Christopher Leah. Reason: Setting notification if replied to
Forum: Developing with WordPress
In reply to: Help me to correct this codeHey @froshdimeji,
Do you have any errors or screenshots to share at all, please? Even in the Chrome developer console do you see any errors there?
Moreover, I assume the comments
//adsense_footer_code
etc. are just JS snippets that will load on the page? Have you managed to output anything to the page with this hook?I’ve never used AMP pages before but your usage looks correct here, I’m not too sure on the
$amp_template
var and is your meant to pass in the template so it can return correctly.That’s why any screenshots of what you see on the AMP pages, or errors in your logs might help debug further.
Let us know, and we’ll see if we can take a look.
Forum: Localhost Installs
In reply to: Cannot access WordPress dashboard for local WP install (MAMP)Glad to hear it @goody2skis and you’re very welcome.
So yes I does sound like the actual site files would be located here:
Applications > MAMP > htdocs > wordpresstest
(this will be your site root where the WordPress core files live)If you dig deeper into the wp-content folder there you will have access to whats typically the files related to your site, with the themes and plugins etc.
One thing I think you may benefit from (if you’re new to local development or WordPress it’s self?) is to maybe use a more friendly local development environment. I personally use Local by Flywheel as it is much simpler to get a local site setup and running than the likes of MAMP.
Let me know if you need anything further buddy.
All the best,
Chris ??Forum: Fixing WordPress
In reply to: PHP Warning: Missing argument 2 for wpdb::prepare()Hey @atomantiii,
So this error is telling you that you are using prepare() method incorrectly.
It expects two parameters, and you’re just passing in one, which is just the SQL query you’re trying to run.
The prepared statement is used to sanitise and format the query before passing it on to the DB.
Here’s an example of how this method works:
$wpdb->prepare( "SELECT id FROM wp_posts WHERE id > %d AND
post_status
= %s", $min_id, $status )
In the example above the
%d
is assigned to the$min_id
var and%s
is assigned to the$status
var.So a rewrite like so should work for your issue:
$date_param = '1970'; $post_datetimes = $wpdb->get_row( $wpdb->prepare(“SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > %d”), $date_param );
Note: This is without testing the code and just from experience, so please let me know how you get on.
- This reply was modified 6 years, 4 months ago by Christopher Leah.
- This reply was modified 6 years, 4 months ago by Christopher Leah.
Forum: Localhost Installs
In reply to: Cannot access WordPress dashboard for local WP install (MAMP)Hey @goody2skis,
From what I can understand initially here, you are looking for the wp-admin area of your site, where you can log in and create pages and posts etc. Is this correct?
If it is and by “takes me to the home page of my website” you mean you see your blank WordPress website’s homepage, then you _should_ be able to visit dashboard area by appending
/wp-admin
to your homepage URL or by removing theindex.php
and replacing the URL withwp-login.php
._Note this is without knowing your local MAMP file paths and/or hostname setups_
Lastly, if this doesn’t help can you please share more information on where your sites are stored in MAMP (e.g. file paths) and any screenshots of your homepage and URLs you’re attempting to visit would be great.
Forum: Plugins
In reply to: [Simple Contact form 7 Wizard Multisteps Form] Form disappear when click NEXTNo problem @wpsenior it was a great time saver at the time. And glad I could help. I’d contribute and merge the fix but by now I’m sure you’ve resolved it.
All the best
Forum: Plugins
In reply to: [Simple Contact form 7 Wizard Multisteps Form] Form disappear when click NEXTI ran into this to.
Great plugin, but due to the structure of my site and use of HTML5 sections, I debug the jquery and realised it was not obtaining the step data value.
I therefore had to amend line 9 in order to make it works for my site to:
var step = jQuery(this).closest("section").data("step");
I hope this can you anyone or even if the developer may want to possible try a more CSS specific approach to targeting the DOM elements used in this plugin.
either way thank you wpsenior for doing this!
Forum: Plugins
In reply to: [Insert JS or CSS in post via Custom Field] UsageHi, a bit late, bu the plugin works great.
f1mktsol, inside the PHP files I noticed the custom fields where simply “js” and “css”.
So an example (which is working for me):
Custom Field Name = "js" Field Value = "filepath/script.js"
Hope this helps.