This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The template for displaying archive pages. | |
| * | |
| * @link https://codex.wordpress.org/Template_Hierarchy | |
| * | |
| * @package Benevolent | |
| */ | |
| get_header(); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Here is a video explaining the code https://d.pr/v/WQ6w7R | |
| // We need to incluide this <meta> tag inside the <head> HTML tag: | |
| // <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| // Below are the actual CSS styles that need to be added to the "more.css" stylesheet | |
| /* Prevent horizontal overflow */ | |
| html { | |
| max-width: 100%; | |
| overflow-x: hidden |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Warning: Illegal string offset 'alt' in /usr/home/josemorraja.com/web/wp-content/themes/josemorraja-v4/single.php on line 53 | |
| // Warning: Illegal string offset 'id' in /usr/home/josemorraja.com/web/wp-content/themes/josemorraja-v4/single.php on line 31 | |
| <?php get_template_part('parts/header'); ?> | |
| <div class="container"> | |
| <div class="row"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('admin_head', 'mrfox_custom_admin_styles'); | |
| function mrfox_custom_admin_styles() { | |
| echo '<style> | |
| .foo { | |
| color:red; | |
| } | |
| </style>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Enable WP_DEBUG mode | |
| define( 'WP_DEBUG', true ); | |
| // Enable Debug logging to the /wp-content/debug.log file | |
| define( 'WP_DEBUG_LOG', true ); | |
| // Disable display of errors and warnings | |
| define( 'WP_DEBUG_DISPLAY', false ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Selecting element | |
| var elem = document.getElementById("intro"); | |
| // Appling styles on element, not camelCase on attributes | |
| elem.style.color = "blue"; | |
| elem.style.fontSize = "18px"; | |
| elem.style.fontWeight = "bold"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.querySelector('.haiku').innerText = ('This is a Haiku') | |
| // This will replace the content inside the first element that matches that CSS selector. | |
| document.querySelectorAll('.haiku')[2].innerText = ('This is a Haiku') | |
| // This will add a (.haiku) to the third element that matches that CSS selector. | |
| document.querySelectorAll('.haiku').forEach(function(i){i.innerText = ('This is a Haiku')}) | |
| // This will replace the content of all elements that match that CSS selector | |
| //There are ways to add content before and after the existing content instead of replacing it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.querySelector('.foo').classList.add('mystyle') | |
| // This will add a classname (.mystyle) to the first element that matches that CSS selector (.foo) | |
| document.querySelectorAll('.foo')[2].classList.add('mystyle') | |
| // This will add a classname (.mystyle) to the third element that matches that CSS selector. | |
| document.querySelectorAll('.foo').forEach(function(i){i.classList.add('mystyle')}) | |
| // This will add a classname (.mystyle) to ALL elements that match that CSS selector. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Redirect users to custom URL based on their role after login | |
| * | |
| * @param string $redirect | |
| * @param object $user | |
| * @return string | |
| */ | |
| function wc_custom_user_redirect( $redirect, $user ) { | |
| // Get the first of all the roles assigned to the user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mrfx_remove_post_dates() { | |
| add_filter('the_date', '__return_false'); | |
| add_filter('the_time', '__return_false'); | |
| add_filter('the_modified_date', '__return_false'); | |
| add_filter('get_the_date', '__return_false'); | |
| add_filter('get_the_time', '__return_false'); | |
| add_filter('get_the_modified_date', '__return_false'); | |
| } | |
| add_action('loop_start', 'mrfx_remove_post_dates'); |