Skip to content

Instantly share code, notes, and snippets.

Avatar

Felicia Ceballos-Marroquin feliciaceballos

View GitHub Profile
@feliciaceballos
feliciaceballos / style-login.css
Last active Mar 12, 2019
Change Login Page Button Color
View style-login.css
body.login div#login form#loginform p.submit input#wp-submit {
background-color:#17a8e3 !important;
}
@feliciaceballos
feliciaceballos / functions.php
Created Mar 11, 2019
Add custom stylesheet to WordPress Login Page
View functions.php
<?php
//If you're using this in your functions.php file, remove the opening <?php
//Replace style-login.css with the name of your custom CSS file
function my_custom_login_stylesheet() {
wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
}
//This loads the function above on the login page
add_action( 'login_enqueue_scripts', 'my_custom_login_stylesheet' );
@feliciaceballos
feliciaceballos / custom_login_page.php
Last active Mar 12, 2019
Removes the "Back to" Link from WordPress Login Page
View custom_login_page.php
<?php
//Here's my custom CSS that removes the back link in a function
function my_login_page_remove_back_to_link() { ?>
<style type="text/css">
body.login div#login p#backtoblog {
display: none;
}
</style>
<?php }
@feliciaceballos
feliciaceballos / functions.php
Created Feb 28, 2019
Get posts from multiple blogs
View functions.php
<?php
//* Display posts from other blogs with WordPress REST API
function fc_display_posts_from_other_blogs() {
// trying to get value from the cache
if( false == $allposts = get_transient( 'misha_remote_cache' ) ) {
// it will be the array with all posts
$allposts = array();
// get the first website latest posts
@feliciaceballos
feliciaceballos / functions.php
Last active Feb 28, 2019
List of Posts with clickable title
View functions.php
<?php
// print posts
foreach( $allposts as $remote_post ) {
$timestamp = strtotime( $remote_post->date_gmt );
$date = gmdate("m/d/y",$timestamp);
echo '<p><a href="' .$remote_post->link.'">'.$remote_post->title->rendered.'</a> ' . $date . '</p>';
}
View page_writing_index.php
<?php
/*
Template Name: Writing Index
*/
//* Adds a CSS class to the body element
add_filter( 'body_class', 'bbs_index_body_class' );
function bbs_index_body_class( $classes ) {
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-10.php
Last active Oct 29, 2018
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Using Forminator API to Get Submissions
View wpmu-dev-forminator-submissions-dashboard-widget-10.php
<?php
/**
* Get Form detail and its submissions
*
* @return bool
*/
protected function get_submissions() {
// Check if we have configured form ID
if ( empty( $this->id ) ) {
echo esc_html( __( 'Please configure which form to display its submissions.' ) );
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-11.php
Last active Oct 29, 2018
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Formatting Submissions
View wpmu-dev-forminator-submissions-dashboard-widget-11.php
<?php
/**
* Render Form Submissions table on html widget
*
* @param Forminator_Custom_Form_Model $form
* @param Forminator_Form_Entry_Model[] $entries
*/
public function render_form_submissions( $form, $entries ) {
$field_labels = array();
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-09.php
Last active Oct 29, 2018
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Get Options
View wpmu-dev-forminator-submissions-dashboard-widget-09.php
<?php
/**
* Get widget Options
*
* @param array $default
*
* @return array
*/
public function get_options( $default = array() ) {
//Fetch ALL dashboard widget options from the db...
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-08.php
Last active Oct 29, 2018
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Update Widget Settings
View wpmu-dev-forminator-submissions-dashboard-widget-08.php
<?php
/**
* Update widget options
*
* @param array $options
*
* @return bool
*/
public function update_options( $options = array() ) {
//Fetch all dashboard widget options from the db...