Skip to content

Instantly share code, notes, and snippets.

@rali14
rali14 / praytimes.js
Created November 18, 2020 21:44
PrayTimes
//--------------------- Copyright Block ----------------------
/*
PrayTimes.js: Prayer Times Calculator (ver 2.3)
Copyright (C) 2007-2011 PrayTimes.org
Developer: Hamid Zarrabi-Zadeh
License: GNU LGPL v3.0
TERMS OF USE:
@rali14
rali14 / functions.php
Last active August 14, 2023 04:16
Shortcode to Display Course Categories
function ld_display_course_categories ($atts) {
$terms = get_the_terms( get_the_ID() , 'ld_course_category' );
if (!$terms) {
// No terms, so just quit.
return false;
}
$categories= "";
foreach ( $terms as $term ) {
@rali14
rali14 / .php
Created May 10, 2019 20:40
Hide the license key within LearnDash
/*
* Temporary function to hide the license key entered for LearnDash LMS
* Add the below to your child theme's functions.php file or as a code snippet using a third party plugin such as: https://en-ca.wordpress.org/plugins/code-snippets/
*/
function ld_hide_license_key() {
echo '"<script type="text/javascript">jQuery( "#nss_plugin_license_sfwd_lms" ).val( "**********" );</script>"';
}
add_action('admin_footer', 'ld_hide_license_key');
@rali14
rali14 / style.css
Created March 26, 2020 16:31
Hide Certificates and Points from LearnDash Profile
/*
* Custom CSS
* Added by: LearnDash Customer Support
*
*/
/* Remove points */
.learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat:last-child {
display: none;
}
@rali14
rali14 / functions.php
Created September 19, 2015 02:24
Order Listings Randomly
function custom_orderby( $query_args ) {
$query_args[ 'orderby' ] = 'title';
$query_args[ 'order' ] = 'ASC';
return $query_args;
}
add_filter( 'job_manager_get_listings_args', 'custom_orderby', 99 );
function custom_orderby_cache( $query_args ) {
$query_args[ 'cache-bust' ] = time();
@rali14
rali14 / functions.php
Last active May 4, 2022 14:07
Display the username instead of first name on Account menu item
function custom_menu_item_name () {
$current_user = wp_get_current_user();
return $current_user->user_login;
}
add_filter( 'listify_acount_menu_user_label', custom_menu_item_name, 99 );
@rali14
rali14 / style.css
Last active May 4, 2022 14:07
Custom Icon for Custom Field Widget
#jmfe_widget-2 > h1:before { /* Replace the ID (jmfe_widget-2) with the widget ID from Step 1 */
content: '\f35b'; /* replace the content here with the icon you would like to use.*/
display: inline-block;
font-family: Ionicons;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
text-rendering: auto;
@rali14
rali14 / functions.php
Created June 9, 2015 02:18
force autolocation on homepage only
function listify_custom_autolocation() {
if ( ! ( is_front_page() ) ) {
return;
}
?>
<script>
jQuery(document).ready(function() {
var locate = jQuery( '.locate-me' );
locate.trigger( 'click' );
});
@rali14
rali14 / quiz.php
Created September 26, 2019 01:49
Display the number of quiz attempts left on the quiz page.
<?php
/**
* Displays a quiz.
*
* Available Variables:
*
* $course_id : (int) ID of the course
* $course : (object) Post object of the course
* $course_settings : (array) Settings specific to current course
* $course_status : Course Status
@rali14
rali14 / profile.php
Created February 13, 2020 19:29
Change the order of first name and last name in LearnDash Profile
<?php
/**
* Displays a user's profile.
*
* Available Variables:
*
* $user_id : Current User ID
* $current_user : (object) Currently logged in user object
* $user_courses : Array of course ID's of the current user
* $quiz_attempts : Array of quiz attempts of the current user