Skip to content

Instantly share code, notes, and snippets.

View onuproy's full-sized avatar
🏠
Working from home

Onup Chandra Barmon onuproy

🏠
Working from home
View GitHub Profile
@onuproy
onuproy / query.php
Created March 6, 2021 20:52 — forked from eliasfaical/query.php
Loop post type WP
<?php
/*
* Loop post type: V1
*/
$posts = array(
array( 'post_type' => 'post1', 'post_per_page' => -1 ),
array( 'post_type' => 'post2', 'post_per_page' => -1 ),
array( 'post_type' => 'post3', 'post_per_page' => -1 )
);
<div class="testimonial">
<?php
$q = new WP_Query(
array('post_type' => array('testimonials'),
'post_status' => array('publish'),
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => $sitem,
'service-category' => $category)
);
<?php
$custom_query_args = array (
'post_type' => 'news',
'posts_per_page' => '4'
);
$custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$custom_query = new WP_Query( $custom_query_args );
@onuproy
onuproy / index.php
Created January 4, 2021 11:40
ACF Repeater loop By Wordpress
<!-- banner-area -->
<div id="owl-id" class="aaaaaa owl-carousel owl-theme">
<!-- single item -->
<?php if(have_rows('hero_slider_item')) :?>
<?php while(have_rows('hero_slider_item')) : the_row();
$add_single_slider = get_sub_field('add_single_slider');
$slider_title = get_sub_field('slider_title');
$slider_sub_title = get_sub_field('slider_sub_title');
$learn_more_button_text = get_sub_field('learn_more_button_text');
@onuproy
onuproy / index.php
Created May 28, 2020 06:53
ACF Custom post Type Left Right Right left WordPress
<?php if(have_rows('onup_row')) : ?>
<?php $i = 0; while(have_rows('onup_row')) : the_row(); $i++;
$title = get_sub_field( 'title' );
$img = get_sub_field( 'image' );
?>
<?php if($i %2 !=0) : ?>
<!-- left image content -->
<img src="<?php echo $img['url'];?>">
<h2><?php echo $title;?></h2>
@onuproy
onuproy / index.php
Created February 20, 2020 09:10
Custom Front Page Templates WordPress
if ( is_front_page() ) :
get_header( 'front' );
else :
get_header();
endif;
<?php if(is_front_page()){ ?>
<div class="logo">
@onuproy
onuproy / index.html
Created October 28, 2019 08:29
CSS Only Responsive Navigation Menu
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>An Anonymous Pen on CodePen</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
@onuproy
onuproy / index.html
Created October 26, 2019 20:06
Sticky Header fixed
<section class="header_logo">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="logo">
<a href="index.html">
<img src="assets/images/LOGO.png" alt="logo">
</a>
</div>
</div>
@onuproy
onuproy / index.html
Created August 7, 2019 09:18
Custom Check box
<div class="col-xl-12">
<label class="custom_checkbox_2">
<input type="checkbox"> <p> <span>I don’t have a Member ID.</span></p>
<span class="checkmark"></span>
</label>
</div>
@onuproy
onuproy / style.css
Created July 22, 2019 09:27
::placeholder color custom
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: pink;
}
::-moz-placeholder { /* Firefox 19+ */
color: pink;
}
:-ms-input-placeholder { /* IE 10+ */
color: pink;
}
:-moz-placeholder { /* Firefox 18- */