Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Template Name: Services
*/
get_header(); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<?php
/*
Template Name: Home
*/
get_header(); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
function search_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_home() || $query->is_search()) {
$query->set('post_type', array( 'post', 'event' ));
}
}
}
add_action('pre_get_posts','search_filter'); ?>
<?php if (have_posts()) : ?>
<?php
$options = array(
'' => 'Filter By Type',
'event' => 'Events',
'post' => 'News',
);
?>
<?php if (isset($_GET['post_type'])): ?>
<?php $current = $_GET['post_type'] ?>
<?php else: ?>
//full
if ($('.article-aside').length === 0) {
$('.article-content').addClass('full');
};
<div class="article-body">
<div class="shell">
<div class="article-content">
<div class="article-entry">
<?php the_content(); ?>
</div><!-- /.article-entry -->
</div><!-- /.article-content -->
<?php get_template_part('fragments/article-aside'); ?>
</div><!-- /.shell -->
$submit_btn = $('.last-step');
$submit_btn.on('click', function(e) {
$('form').trigger('submit');
e.preventDefault;
});
function crb_handle_valcher_form() {
$post_content = array();
$response = array(
'status' => false,
'errors' => array(),
);
$email = $_POST['email'];
$post_title = $email;
add_action('wp', 'crb_import_joomla_events');
function crb_import_joomla_events() {
if (!isset($_GET['events_import'])) {
return false;
}
error_reporting(E_ALL);
var widgetTitles = $('.home .cols .widget').find('h2');
widgetTitles.each(function(e) {
e.preventDefault;
var $linkMore = $(this).find('.view-more');
$linkMore.clone().appendTo($(this));
});