This file contains 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 | |
/** | |
* Registers all ShortCode_* methods | |
*/ | |
static public function Register_ShortCodes() { | |
// part of string to search for | |
$keyword = 'ShortCode_'; | |
// loop all class methods | |
foreach( get_class_methods(__CLASS__) as $method ) { |
This file contains 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
$request = 'code_in_the_url'; | |
$response = 'code_returned'; | |
if ( $_SERVER['REQUEST_URI'] === ( '/.well-known/acme-challenge/' . $request ) ) { | |
echo $request . '.' . $response; | |
exit; | |
} |
This file contains 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
<!--Carrossel--> | |
<div class="row"> | |
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> | |
<!-- Wrapper for slides --> | |
<div class="carousel-inner" role="listbox"> | |
<?php wp_reset_query(); ?> | |
<?php query_posts('category_name=slider&posts_per_page=5'); ?> | |
<?php $cont = 0; ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<div class="item <?php if($cont == 0): echo"active"; ?><?php endif; ?>"> |
This file contains 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 | |
add_action( 'init', 'register_new_post_type' ); | |
function register_new_post_type(){ | |
$args = array( | |
'label' => 'Post title', | |
'show_ui' => true, | |
'public' => true, | |
'hierarchical' => true, | |
'has_archive' => true, | |
'supports' => array( 'title' ), |
This file contains 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 query_posts('cat=7'); ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<div class="col-md-4"> | |
<h3><?php the_title(); ?></h3> | |
<?php the_excerpt(__('(more…)')); ?> | |
<a class="btn btn-default" href="<?php the_permalink() ?>" role="button">Read More</a> | |
</div> | |
<?php endwhile; endif; ?> |
This file contains 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
/* Custom image sizes to Media Library */ | |
function wp_70048_remove_image_sizes( $sizes ) { | |
unset( $sizes['thumbnail'] ); | |
unset( $sizes['medium'] ); | |
unset( $sizes['large'] ); | |
unset( $sizes['full'] ); | |
return $sizes; | |
} |
This file contains 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
// Credit @rmulugeta https://wordpress.org/support/users/rmulugeta/ | |
// from https://wordpress.org/support/topic/child-theme-not-overriding-parent-stylecss/ | |
<?php | |
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); | |
function theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', | |
get_stylesheet_directory_uri() . '/style.css', | |
array('parent-style') | |
); |
This file contains 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 | |
/** | |
* Get blog posts page URL. | |
* | |
* @return string The blog posts page URL. | |
*/ | |
function km_get_blog_posts_page_url() { | |
// If front page is set to display a static page, get the URL of the posts page. |
This file contains 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 | |
define('WP_HOME', "http://{$_SERVER['HTTP_HOST']}/"); | |
define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}/"); |
This file contains 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 | |
function rs_menu_classes( $classes, $item, $args ) { | |
if($args->theme_location == 'primary') { | |
$classes[] = 'list-inline-item'; | |
} | |
return $classes; | |
} | |
add_filter( 'nav_menu_css_class','atg_menu_classes',1,3 ); |