Skip to content

Instantly share code, notes, and snippets.

View aslamhindko's full-sized avatar

Aslam Hindko aslamhindko

View GitHub Profile
YE sab se zarory hain
/*xs*/
@media (min-width: 1px) and (max-width: 767px){ mobile
}
/*sm*/
@media (min-width: 768px) and (max-width: 992px){ tablate
}
/*MD*/
<?php echo substr(get_the_title(), 0, 55); ?>... |blog post title ki limit kam karni ho tu ye code lagain ge
<?php echo substr(strip_tags(get_the_content()),0,150); ?>... |blog post ki post limit kam karni ho tu ye code lagain ge
<?php echo substr(str_replace('h1', 'p',get_the_content()), 0 , 150); ?> agar post main h1 araha hain us ko show p main karwana hain tu replace u kare ge
<?php the_title(); ?> |Loop ka title
<?php the_content(); ?> | Loop ka content
<?php echo get_the_content(); ?> | is code hi html se p nahi utain ga jesa hain h1 ya h2 waghera wesa hi call kare ga
<?php echo get_template_directory_uri(); ?>/ | ye wordpress ka function hain is ko hum css javascript or images waghera main use karte hain href="is dalte hain hreff k under css main src k under or java orimage main bi
<?php echo site_url(); ?> ye maen site ka url uthain ga
<?php echo get_permalink($post->ID);?>"> Ye blog post k liye permalink lagana hota hain($post->ID)ye blog post ki id uthian ga
<!--HTML--> Navi ko Full page id k uper rakhe ge
<header id="header">
<div class=" clear">
<a href="/" id="logo"><img src="assets/images/logo.png" alt="Homepage"/></a>
<a class="menu" title="Show Menu"><span>Menu</span></a>
<nav id="topMenu"><div class="ins"><div class="scroll">
<a href="/">Home</a>
<a href="#">Work</a>
<a class="sub">Services</a>
<div class="sm">
ye pora page counter se dynemic banahowa hain wp ka
<?php
/**
* Template Name: Treatment
*/
get_header(); ?>
<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(),'full', true);
?>
owl slider main ye jquery deni hoti hain
$(".logoes").owlCarousel({
loop:true,
margin:0,
nav:true,
responsive:{
0:{
items:2
},
600:{
agat wordpress main har page per alag header image leni ho tu is k liye code dege
<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(),'full', true); ?>
<section class="treatmentpage" style="background: url(<?php echo $thumbnail[0]; ?>) no-repeat;">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1><?php the_title(); ?></h1>
<ol class="breadcrumb">
(ye wordpress loop counter hain agar meri post type multiple ho tu use hogi)
<div class="container">
<div class="row">
<div class="col-md-12">
<?php
$q = new WP_Query(
array('post_type' => array('product'),
'post_status' => array('publish'),
'orderby' => 'date',
'order' => 'ASC',
(agar loop main BG image ho tu ye loop use kare ge = loop ka akari main background ki css rakhe ge)
<?php $my_query = new WP_Query('page_id=45');
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php
if(has_post_thumbnail()){
$thumbnailaaa = wp_get_attachment_image_src(get_post_thumbnail_id(),'full', true);
}
?>
.pagination {clear:both;padding:20px 0;position:relative;font-size:11px;line-height:13px;}
.pagination span, .pagination a {display: block;float: left;margin: 2px 2px 2px 0;padding: 11px 17px 11px 17px;text-decoration: none;width: auto;color: #fff;background: #555;font-size: 18px;}
.pagination a:hover{color:#fff;background: #AA3F94;}
.pagination .current {padding: 11px 17px 11px 17px;background: #AA3F94;color: #fff;font-size: 18px;}
function pagination($pages = '', $range = 4)
{
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '')
{
global $wp_query;