If You want to use Google Font on your WordPress site, You will need to enqueue it in the functions.php
Now just add the following CSS
* {
font-family: 'Poppins', sans-serif;
}
If You want to use Google Font on your WordPress site, You will need to enqueue it in the functions.php
Now just add the following CSS
* {
font-family: 'Poppins', sans-serif;
}
<!--ACF HIDE IF EPMTY CUSTOM FIELD -->
<?php if( get_field('mobil') ): ?>
<li><?php the_field('mobil'); ?></li>
<?php endif; ?>
<!--IF ELSE HIDE - SHOW DIV IF THE_FILED IS EMPTY!!!!!!!-->
<?php if( get_field('hogyan_keszult_link') ){ ?>
<style type="text/css">.hogy-keszul-cta{
display:block;
}</style>
<?php
}?>
//CUSTOM FIELDS SELECET OPTIONS
<?php if( get_field('color') == 'red' ): ?>
<p>Selected the Red choice!</p>
<?php endif; ?>
<?php
//TESTIMONIAL
function post_carousel_loop() { ?>
<div class="container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<!--LOOP ACTIVE ITEMS-->
<?php wp_reset_postdata();
$the_query = new WP_Query(array(
'post_type' => 'testimonial',
'posts_per_page' => 1
));
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="carousel-item active">
<div class="row">
<div class="col-md-12">
<h2 class="carousel-title">Our Patients Say</h2>
<?php the_excerpt(); ?>
<h4 class="author">
<?php the_title(); ?>
</h4>
</div>
</div><!--row-->
</div><!--item-active-->
<?php endwhile; wp_reset_postdata(); ?>
<!--LOOP ITEMS-->
<?php
$the_query = new WP_Query(array(
'post_type' => 'testimonial',
'posts_per_page' => 3,
'offset' => 1
));
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="carousel-item">
<div class="row">
<div class="col-md-12">
<h2 class="carousel-title">Our Patients Say</h2>
<?php the_excerpt(); ?>
<h4 class="author">
<?php the_title(); ?>
</h4>
</div>
</div><!--row-->
</div><!--item-active-->
<?php endwhile; wp_reset_postdata(); ?>
</div>
<div class="carousel-control-wrapper">
<a class="carousel-control-prev" data-target="#myCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" data-target="#myCarousel" role="button" data-slide="next">
<i class="fas fa-chevron-right"></i>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<?php
}
add_shortcode('testimonial-carousel', 'post_carousel_loop');
?>
<?php
wp_reset_postdata();
$args = array(
'post_type' => 'team',
'posts_per_page' => 100
);
$the_query = new WP_Query( $args );
?>
<div class="container">
<div class="row">
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-md-4">
<div class="card member">
<a href="<?php the_permalink(); ?>">
<img class="card-img-top" src="<?php the_field('image'); ?>" alt="">
</a>
<div class="card-body">
<h3 class="card-title"><?php the_title(); ?></h3>
<p class="card-text hidden"><?php the_field('description'); ?></p>
<a class="hidden" href="<?php the_permalink(); ?>" class="btn btn-primary">Read more</a>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div><!--row-->
</div><!--container-->
<?php wp_reset_postdata(); ?>
add_action( 'template_redirect', 'snippet_add_product_to_cart' );
function snippet_add_product_to_cart() {
// select ID
$product_id = 21874;
//check if product already in cart
if ( WC()->cart->get_cart_contents_count() == 0 ) {
// if no products in cart, add it
WC()->cart->add_to_cart( $product_id );
}
}
add_action( 'wp', 'add_product_to_cart_on_page_id_load' );
function add_product_to_cart_on_page_id_load() {
// product ID to add to cart
$product_id = 21874;
// page ID to target
if ( is_page( 19473 ) ) {
WC()->cart->empty_cart();
WC()->cart->add_to_cart( $product_id );
}
}
If the shortcode produces a lot of HTML then ob_start can be used to capture output and convert it to a string as follows:
//ADD CUSTOM FIELD TO SINGLE PRODUCT BEFORE ADD TO CART BUTTON
add_action( 'woocommerce_single_variation', 'add_custom_field_before_addtocart', 5 );
function add_custom_field_before_addtocart() {
include('woo/custom-field.php');
}
<?php the_field('custom'); ?>
// =========================================================================
// REGISTER NEW WIDGET
// =========================================================================
function custom_widgets_init() {
register_sidebar( array(
'name' => 'Custom Widget',
'id' => 'custom-widget-id',
'before_widget' => '<div class="custom-widget">',
'after_widget' => '</div>',
'before_title' => '<h4 class="custom-title">',
'after_title' => '</h4>',
) );
}
add_action( 'widgets_init', 'custom_widgets_init' );
<?php dynamic_sidebar('Custom Widget'); ?>
<?php
function wpf_filter_gettext( $translated, $original, $domain ) {
if ( $translated == "OLD_TEXT" ) { $translated = "NEW_TEXT"; }
return $translated;
}
add_filter( 'gettext', 'wpf_filter_gettext', 10, 3 );
function remove_translation( $translated_text, $untranslated_text, $domain ) {
$removable_text = 'Ide kerül az eltávolítani kívánt kifejezés.';
if ($untranslated_text === $removable_text ) {
return '';
}
return $translated_text;
}
/**
* @snippet Add Conversion Tracking Code to Thank You Page
*/
add_action( 'woocommerce_thankyou', 'bbloomer_conversion_tracking_thank_you_page' );
function bbloomer_conversion_tracking_thank_you_page() {
?>
<!-- Google Code for Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 000000000000;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "kjsdhfkjhkfsdfsdf";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/000000000000/?label=kjdhfsdjfkjkjshdkkkjsdkk&guid=ON&script=0"/>
</div>
</noscript>
<?php
}
add_action('woocommerce_email_after_order_table', 'add_email_shipping_text');
function add_email_shipping_text(){
echo '';
}
add_action( 'woocommerce_email_before_order_table', function(){
if ( ! class_exists( 'WC_Payment_Gateways' ) ) return;
$gateways = WC_Payment_Gateways::instance(); // gateway instance
$available_gateways = $gateways->get_available_payment_gateways();
if ( isset( $available_gateways['bacs'] ) )
remove_action( 'woocommerce_email_before_order_table', array( $available_gateways['bacs'], 'email_instructions' ), 10, 3 );
}, 1 );
{order_date} keltezésű {site_title} rendelés visszaigazolása
</pre>
//Redirect Contact Form 7 to custom thank you page
add_action( 'wp_footer', 'redirect_cf7' );
function redirect_cf7() {
echo '<script type="text/javascript">
document.addEventListener( "wpcf7mailsent", function( event ) {
if ( "form_id" == event.detail.contactFormId ) {
location = "link";
}
}, false );
</script>';
}
<pre>
function add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
$payment_method = $order->payment_method;
if ( $payment_method == 'bacs' ) {
echo 'Your text';
}
}
add_action( 'woocommerce_email_before_order_table', 'add_content_specific_email', 20, 4 );
<?php
/**
* Plugin Name: Disable Comments
* Plugin URI: https://codex.wordpress.org
* Author: @wpflames
*/
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
add_action('admin_init', 'df_disable_comments_post_types_support');
// Close comments on the front-end
function df_disable_comments_status() {
return false;
}
add_filter('comments_open', 'df_disable_comments_status', 20, 2);
add_filter('pings_open', 'df_disable_comments_status', 20, 2);
// Hide existing comments
function df_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments;
}
add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function df_disable_comments_admin_menu() {
remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'df_disable_comments_admin_menu');
// Redirect any user trying to access comments page
function df_disable_comments_admin_menu_redirect() {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url()); exit;
}
}
add_action('admin_init', 'df_disable_comments_admin_menu_redirect');
// Remove comments metabox from dashboard
function df_disable_comments_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'df_disable_comments_dashboard');
// Remove comments links from admin bar
function df_disable_comments_admin_bar() {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
}
add_action('init', 'df_disable_comments_admin_bar');
//END DISABLE COMMENTS
//REMOVE LOST PASSWORD
function remove_lostpassword_text ( $text ) {
if ($text == 'Elfelejtett jelszó?'){$text = '';}
return $text;
}
add_filter( 'gettext', 'remove_lostpassword_text' );