rssail
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WordPress not obeying css rules on mobile devicesmin-width was set and was messing up the display. Problem solved. Not a wordpress bug after all!
Forum: Fixing WordPress
In reply to: wordpress creating js error unable to find functionadded
jQuery(document).ready(function($) {
and that fixed the last problem. Thank you for your help!
- This reply was modified 5 years, 4 months ago by rssail.
Forum: Fixing WordPress
In reply to: wordpress creating js error unable to find functionremoving the jquery load fixed the problem but created another one. I’m calling myFlexslider.js which has the following function:
$(window).load(function() { $('.flexslider').flexslider({ animation: "fade", easing: "swing", direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" reverse: false, animationLoop: true, slideshow: true, //Boolean: Animate slider automatically slideshowSpeed: 10000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationSpeed: 2000, //Integer: Set the speed of animations, in milliseconds initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds randomize: false, //Boolean: Randomize slide order }); });
The console says $ is not a function. I changed that to jquery and it says jquery not defined
Forum: Fixing WordPress
In reply to: wordpress creating js error unable to find functionI tried the healthcheck plugin and it says everything is running smoothly. By the way, your suggestion to ask a host provider for help is pretty comical.
This is a wordpress issue coming from using jquery and linking to resources inside the body tag. While not recommended linking within the body should not create the problem.
If you use the code supplied and set up a new page with it you should be able to reproduce the error. Can you help?
Forum: Fixing WordPress
In reply to: wordpress creating js error unable to find functionThe error only appears on that specific page. It’s a place where I’m using jquery. Here’s the code for the page:
<link href="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/css/myflexslider.css" rel="stylesheet" type="text/css"> <link href="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/flexslider.css" rel="stylesheet" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/jquery.flexslider.js"></script> <script src="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/js/myFlexslider.js"></script> <div class="all-mobile"> <h1>Mobile version under construction</h1> </div> <div class="det-container"> <div class="det-topFlex"> <div class="det-left flexslider"> <ul class="slides"> <li><img src="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/demo/images/kitchen_adventurer_caramel4.jpg"> <div class="det-sliderCaption"> <div class="caption">Caption one.</div> </div> </li> <li><img src="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/demo/images/kitchen_adventurer_donut.jpg"> <div class="det-sliderCaption"> <div class="caption">Caption two.</div> </div> </li> <li><img src="https://www.sustainablewestonma.org/wp-content/themes/twentytwelve-child/jquery/flexslider/demo/images/kitchen_adventurer_lemon.jpg"> <div class="det-sliderCaption"> <div class="caption">Caption three.</div> </div> </li> </ul> </div> <div class="det-right det-verticalFlex"> <span><b>Get Involved</b></span> <div class="det-4links"> <span><a href="https://sustainablewestonma.org/get-involved">Sign up for our<br class="wp">Quarterly Newsletter</a></span></div> <div class="det-4links"> <span><a href="https://www.sustainablewestonma.org/calendar/">Attend an<br class="wp"> Event</a></span></div> <div class="det-4links"> <span><a href="https://sustainablewestonma.org/get-involved">Volunteer with<br class="wp">SWAG</a></span></div> <div class="det-4links"> <span><a href="https://www.sustainablewestonma.org/donate/">Donate to help<br class="wp">our work</a></span></div> </div> </div> </div>
and here’s the css
.flex-control-nav.flex-control-paging{ display:none; } ul.flex-direction-nav{ list-style:none; margin:0; } .det-sliderCaption{ display:flex; justify-content:center; } .flexslider{ margin:0!important; border:none!important; } .slides{ margin:0!important; } .caption{ position:absolute; bottom:1vw; color:white; } .det-container{ margin-top:2vw; } .det-topFlex{ display:flex; justify-content:space-between; } .det-topFlex .det-left{ width:64%; } .det-topFlex .det-right{ width:37%; margin-left:2%; padding-bottom:3vw; background-color:#b3d7f7; } .det-topFlex .det-top img{ width:100%; height:100%; } .det-verticalFlex{ display:flex; flex-direction:column; align-items:center; justify-content:space-between; background-color:#b3d7f7; } .det-topFlex .det-right span{ text-align:center; font-size:2vw; color:#538231; margin:1.6vw 0; } .det-4links span{ display:block; color:white; background-color:#538231; width:17vw; font-size:1.5vw!important; text-align:center; border-radius:3vw; } .det-4links a{ text-decoration:none; color:white; } .det-4links a:visited{ color:white; }
Forum: Fixing WordPress
In reply to: wordpress creating js error unable to find functionI’m using the latest version of chrome on a windows 10 64 bit desktop. The site is hosted at BlueHost. The page in question can be found here https://www.sustainablewestonma.org/campaigndetail/
I’m really a newbe at wordpress. If I reinstall wordpress will I lose my site? If I remove plugins won’t the site stop working?
Forum: Fixing WordPress
In reply to: redirect not workingI adapted the following from CS50 and it works
function redirect($destination){
// handle URL
if (preg_match(“/^https?:\/\//”, $destination)){
header(“Location: ” . $destination);
}else if (preg_match(“/^\//”, $destination)){
// handle absolute path
$protocol = (isset($_SERVER[“HTTPS”])) ? “https” : “http”;
$host = $_SERVER[“HTTP_HOST”];
header(“Location: $protocol://$host$destination”);`
}else if (preg_match(“/^www/”,$destination)){
//handle www addresses (added by rss)
$protocol = (isset($_SERVER[“HTTPS”])) ? “https” : “http”;
header(“Location: $protocol://$destination”);
}else{
// handle relative path
// adapted from https://www.php.net/header
$protocol = (isset($_SERVER[“HTTPS”])) ? “https” : “http”;
$host = $_SERVER[“HTTP_HOST”];
$path = rtrim(dirname($_SERVER[“PHP_SELF”]), “/\\”);
header(“Location: $protocol://$host$path/$destination”);}
// exit immediately since we’re redirecting anyway
/****************
print($_SERVER[“HTTPS”].'<br>’);
print($_SERVER[“HTTP_HOST”].'<br>’);
print($host.'<br>’);
print($path.'<br>’);
print($destination.'<br>’);
print_r2($_SERVER);
*****************/
exit;
}- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
- This reply was modified 5 years, 4 months ago by rssail.
Forum: Fixing WordPress
In reply to: turn off auto formatting in code editorthanks, I tried that but it doesn’t seem to work. Is there a way to edit a PAGE’s html and not have any auto formatting done to it. Everything I’ve tried keeps reformatting the html when I come back to the page. Honestly, this makes the editor almost useless when designing a complicated page. I’ve resorted to using atom on my pc and then do a copy and paste. Is this really the best wordpress can offer? What settings would you use on tinymce-advance? The lack of a decent editor is a major drawback
Forum: Developing with WordPress
In reply to: mouseleave give inconsistent resultsHi Joy, thanks for taking the time to respond. Unfortunately, we have to use javascript to get the desired action. It’s not possible to do with just css. The issue is when a specific element is touched we need to change the css of a different element.
Forum: Developing with WordPress
In reply to: Unable to connect and print data from databaseThanks, I tried using $wpdb but the documentation is really poor. Do you have an example of how to connect to a database and query data into an array? I’m using the following and it seems to work.
require( ‘wp-load.php’ );
$local =’xxx’;
$user =’xxx’;
$pass =’xxx’;
$data =’xxx’;$testConnection = mysqli_connect($local,$user,$pass, $data);
if (!$testConnection) {
die(‘Error: ‘ . mysqli_connect_errno() . PHP_EOL);
}
echo ‘Database connection working!’;$result = mysqli_query($testConnection, “SELECT * FROM _J1D_options”);
$results = [];
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC))
{
$results[] = $row;
}//$results has all that you need
print_r($results);mysqli_free_result($result);
$testClosed = mysqli_close($testConnection);
if ($testClosed) {
echo “closed”;
}?>
Forum: Developing with WordPress
In reply to: Unable to connect and print data from database_J1D_ is in fact a proper wp database name. Also, the problem was solved using mysqli_query