Skip to content

Instantly share code, notes, and snippets.

View ButlerFuqua's full-sized avatar

Butler Fuqua ButlerFuqua

View GitHub Profile
wp_nav_menu(array(
'theme_location' => 'primaryNavigation',
'container_id' => 'navbarResponsive', // Add id to ul container
'container_class' => 'collapse navbar-collapse', // Add class to ul container
'menu_class' => 'menu navbar-nav ml-auto', // Add class to ul
));
wp_nav_menu(array(
'theme_location' => 'primaryNavigation',
<!-- Materialize CSS with fallback -->
<script>
function fallbackMaterialize() {
var mLink = document.createElement('LINK');
mLink.setAttribute('rel', 'stylesheet');
mLink.setAttribute('href', 'assets/css/materialize.css');
document.querySelector('head').appendChild(mLink);
}
</script>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<hr />
<br>
<br>
<button>Button</button>
/**
* Add REST API for BBPress
* /
* Thanks to Barry at https://bbpress.org/forums/topic/is-there-an-api-for-bbpress/
*/
function bbpress_enable_rest_api() {
$types = array(
bbp_get_reply_post_type(),
bbp_get_forum_post_type(),
bbp_get_topic_post_type(),
// https://github.com/GeekyAnts/vue-native-core/issues/117
//In app.json put:
"sourceExts": [
"js",
"json",
"ts",
"tsx",
"jsx",
"vue"
if (document.readyState !== 'loading') {
readyFunction();
} else {
document.addEventListener('DOMContentLoaded', function () {
readyFunction();
});
}
function readyFunction(){
//
<?php
$link = mysqli_connect("HOST", "USERNAME", "PASSWORD", "DATABASENAME");
if(mysqli_connect_error()){
die("There was an error connecting to the database.");
}
if($_POST){
<?php
$link = mysqli_connect("HOST", "USERNAME", "PASSWORD", "DATABASE");
if(mysqli_connect_error()){
die("There was an error connecting to the database.");
}
<?php
$link = mysqli_connect("HOSTNAME", "DATABSEUSERNAME", "PASSWORD", "DATABASE");
if(mysqli_connect_error()){
die("There was an error connecting to the database.");
}
$query = "SELECT * FROM users";
function findAncester(el, cls) {
while (((el = el.parentElement) && !el.classList.contains(cls)) || el.tagName === "BODY");
return el;
}