montrealist
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: redirect page after audio play endedYou need to use the
ended
event on theaudio
element to redirect (my answer is untested and is guided by this SO answer). Make sure you pass a CSS class so that JavaScript would know which element to fetch (in this example it’sfoobar
).<?php $attr = array( 'src' => ''.$mp3.'', 'loop' => '', 'autoplay' => 'on', 'preload' => 'none', 'class' => 'foobar' ); echo wp_audio_shortcode( $attr ); ?>
I wrapped the JavaScript call in a
DOMContentLoaded
callback because the HTML needs to be parsed for the script to work. You can do it more elegantly by putting the script into your theme/plugin JS or enqueueing it in case it doesn’t yet exist.<script type="text/javascript"> document.addEventListener('DOMContentLoaded', function(event) { var audio = document.getElementsByClassName('foobar')[0]; function endHandler() { alert('playing ended, can redirect now'); } audio.addEventListener('ended', endHandler, false); }); </script>
Forum: Developing with WordPress
In reply to: WP_User_Query PHPIs this what you want?
$user_query = new WP_User_Query( array( 'role' => 'Subscriber' ) );
There are many examples here:
https://codex.www.ads-software.com/Class_Reference/WP_User_Query
Forum: Fixing WordPress
In reply to: Website asking for a passwordLooks like someone inserted a password form on the server level. I suggest you get in touch with your hosting provider for support as well as read through this document:
https://codex.www.ads-software.com/FAQ_My_site_was_hacked
There’s also a forum tag specifically for cases of hacked sites:
Forum: Fixing WordPress
In reply to: 3 sites on one host but getting 404 with only my own IP addressNot being able to access cPanel and not being able to access your site sounds like two issues, but since they’re occurring simultaneously it’s likely a hosting issue. Have you tried asking your host for help?
Where is the
wp-config.php
(and other WordPress files/folders) located exactly? Inside yourhtdocs
folder or insidehtdocs/wp
? Just a hunch, but perhaps you are mixing two things together: trying to install WordPress and trying to install WordPress in a subdirectory.Forum: Fixing WordPress
In reply to: CodeIgniter trackingJust go with the ‘static website’ section of this doc:
https://support.google.com/analytics/answer/1008080?hl=en
I assume your CI pages are all static pages stored somewhere. If your ‘thank you’ pages are generated dynamically, go with ‘dynamic website’ section.
Forum: Fixing WordPress
In reply to: Login.php is blank and can’t get to adminWhat actions broke the site? I assume it was working at one point in time. Did you update WordPress? Install new theme/plugin, anything else?
Forum: Fixing WordPress
In reply to: Redirecting a category archive page to an existing post/page?You can use a hook to redirect, as in this example: https://wordpress.stackexchange.com/a/160853/8105
Forum: Fixing WordPress
In reply to: My feed does not validate.What’s your feed URL? Also, can you paste the complete error stack on something like https://pastebin.com/ and include the link here?
Forum: Fixing WordPress
In reply to: FastCGI error after updating Error 500Were you the one who configured FastCGI on the server? If yes can you turn it off and see if it fixes the issue? If no then who was it and can you ask them to turn it off? Your host could likely assist you with it as well – have you contacted them?
Forum: Fixing WordPress
In reply to: preview looks ok but final page shows displaying errorsSounds like your theme works in some special way. What’s the theme name? Have you tried their support?
Forum: Everything else WordPress
In reply to: Create email alias for user/subscriberThat sounds more like something outside of WordPress – it’s “email setup on server” type stuff. You could probably automate it somehow so that a WordPress plugin would trigger a creation of an e-mail alias, but ultimately it’s something that happens at server configuration level.
Forum: Fixing WordPress
In reply to: Download links not working after moving site to a subfolderAre those links residing inside post content? If so you’ll need to either change those manually or perform a search-and-replace on your database with a tool like search-replace-DB (https://github.com/interconnectit/Search-Replace-DB). The latter is recommended only if you know what you’re doing and can test it on a local install first to make sure it won’t break anything.
Forum: Fixing WordPress
In reply to: Image being resized? Cant figure this outIt looks like it’s the CSS rule from twentyseventeen theme for all images:
img { max-width: 100%; }
It’s possible even if you log in to the same site in two different browsers (i.e. Firefox and Chrome). Given that you’re still logged in on computer #1, what if you change your password there to something that will work 100% (open a simple text editor – not Word! – type your password there and paste it)? Have you tried that?