Skip to content

Instantly share code, notes, and snippets.

@Jimmi08
Jimmi08 / pagination.php
Created October 29, 2019 11:14 — forked from robmint/pagination.php
Pagination like flickr, digg, github - the standard pagination pattern
<?php
// based on the work of Jason Coleman
// http://www.strangerstudios.com/blog/2006/07/paginate-your-site-like-digg/
/* The pagination function simply spits out a data structure
that you can render any way you like.
See also the javascript version for node:
https://gist.github.com/robmint/4651cf1c6f336e663dba
*/
@Jimmi08
Jimmi08 / bootstrap-all-elements.html
Created September 13, 2022 10:18 — forked from letanure/bootstrap-all-elements.html
List of all bootstrap components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap all elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@Jimmi08
Jimmi08 / wp-disable-plugin-update.php
Created October 23, 2022 06:25 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@Jimmi08
Jimmi08 / cf7-get-page-url-of-sender.php
Created November 6, 2022 10:25 — forked from sinebeef/cf7-get-page-url-of-sender.php
Contact Form 7 GET slug/url hidden
//https://wordpress.stackexchange.com/questions/291855/how-to-get-current-url-in-contact-form-7
//You can use cf7 hidden field shortcodes + get parameters: https://contactform7.com/hidden-field/ https://contactform7.com/getting-default-values-from-the-context/
//In the mail form I use such shortcodes to get these slugs
[hidden utm_source default:get]
[hidden utm_medium default:get]
[hidden utm_campaign default:get]
[hidden utm_content default:get]
@Jimmi08
Jimmi08 / dumprequest.php
Created December 23, 2022 10:21 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@Jimmi08
Jimmi08 / functions.php
Created June 12, 2023 07:53 — forked from paulcollett/functions.php
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin”
// For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php...
// Remove All Yoast HTML Comments
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
// Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423)
add_filter( 'wpseo_debug_markers', '__return_false' );
// For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php...
@Jimmi08
Jimmi08 / WP posts on map
Created January 7, 2025 13:16 — forked from farichello/WP posts on map
WP posts on map
// SCF Google Map API Key
function my_acf_init() {
acf_update_setting('google_api_key', 'YOUR_API_KEY');
}
add_action('acf/init', 'my_acf_init');
function us_portfolio_google_map_shortcode() {
// Getting an API key
$google_api_key = acf_get_setting('google_api_key');