SlideShare a Scribd company logo
1 of 19
Download to read offline
Responsive Web Design
tehnike u WordPressu
Igor Benić WP Meetup Zagreb 19.09
Sadržaj
• O meni
• Što je RWD?
• Izrada RWD-a
• Slike u RWD-u
• WordPress i RWD
• Slike u WordPress-u
• WordPress Mobile
• Pitanja
O meni
• Front End Developer @ Multilink
• Co-founder – www.lakotuts.com
• PSD -> PHP
• Autor knjige: WordPress na Bootstrap-u 3.x
O meni
• Bootstrap 3
• Izrada osnovne i naprednih tema
• Customizer API
• Settings API
• AJAX
http://leanpub.com/wpb3
Što je RWD?
• Stranica (sadržaj) se prilagođava ekranu
– Točke izmjene
• Vrste RWD-a
– Responsive
– Adaptive
• Sadržaj
• Brzina
Izrada RWD-a
• Mobile First
• Desktop First
• Korištenje Alata
• CSS od nule
• Korištenje Frameworka
Načini izrade - Framework
• Bootstrap 3
• Foundation
• Skeleton
• Gumby
• Mnogi drugi
Slike u RWD-u
• Nisu jednostavne
– Servirati samo potrebnu sliku
– Paziti i na Retina ekrane
• Moguća rješenja
– Picturefill 2.0
– BttrLazyLoading
Slike u RWD-u – PictureFill 2.0
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source srcset="examples/images/extralarge.jpg" media="(min-
width: 1000px)">
<source srcset="examples/images/large.jpg" media="(min-width:
800px)">
<source srcset="examples/images/large@2.jpg" media="(min-
width: 800px) and (-webkit-min-device-pixel-ratio: 2)">
<!--[if IE 9]></video><![endif]-->
<img srcset="examples/images/medium.jpg" alt="A giant stone
face at The Bayon temple in Angkor Thom, Cambodia">
</picture>
Slike u RWD-u – BttrLazyLoading
<img id="yourImageId" class="bttrlazyloading"
data-bttrlazyloading-xs-src="img/768x200.gif"
data-bttrlazyloading-xs-width="768"
data-bttrlazyloading-xs-height="200"
data-bttrlazyloading-sm-src="img/345x250.gif"
data-bttrlazyloading-sm-width="345"
data-bttrlazyloading-sm-height="250"
data-bttrlazyloading-md-src="img/455x350.gif"
data-bttrlazyloading-md-width="455"
data-bttrlazyloading-md-height="350" d
data-bttrlazyloading-lg-src="img/360x300.gif"
data-bttrlazyloading-lg-width="360"
data-bttrlazyloading-lg-height="300" />
WordPress i RWD
RESS
Pružanje sadržaja ovisno o uređaju
Prilagodba sadržaja na serveru
Slike u WordPress-u
• Različite verzije za istu sliku
– add_image_size(“verzija”, širina, visina, [true |
false]);
• add_filter(“post_thumbnail”,
funkcija_za_promjenu);
Slike u WordPress-u - Thumbnailovifunction wpb3_thumbnail_html($html, $post_id, $aid, $sizeThumb, $attr){
if($sizeThumb == "slika-clanka"){
$sizes = array('slika-clanka‘, 'slika-clanka-md‘, 'slika-clanka-sm‘, 'slika-clanka-xs’);
$img = "<img class='bttrLazyLoading img-responsive' alt='".get_the_title()."'";
$sizeBttr = "";
$width = "";
$height = "";
$aid = (!$aid) ? get_post_thumbnail_id() : $aid;
foreach ( $sizes as $size ) {
$url = wp_get_attachment_image_src( $aid, $size );
switch ($size) {
case 'slika-clanka':
$sizeBttr = "lg";
$width = "750";
$height= "353";
break;
...
}
$img .= " data-bttrlazyloading-".$sizeBttr."-src='". $url[0] ."' ";
$img .= " data-bttrlazyloading-".$sizeBttr."-width='". $width ."' ";
$img .= " data-bttrlazyloading-".$sizeBttr."-height='". $height ."' ";
}
$img .= " />";
return $img;
}
return $html;
}
add_filter(
'post_thumbnail_html',
'wpb3_thumbnail_html', 10, 5);
Slike u WordPress-u - Content
• Filtrirati slike prilikom ispisa ili obrisati (na mobitelima)
– add_filter(‘the_content’, ‘funkcija za filtriranje slika’)
• CSS:
– .post img {max-width:100%;height:auto;}
function slike_u_content() {
global $post;
$html = preg_replace_callback( '#(<imgs[^>]*src)="([^"]+)"#', "callback_img",
get_the_content($post->ID) );
return $html;
}
function callback_img($match) {
list(, $img, $src) = $match;
$url = get_stylesheet_directory_uri().'/img_placeholder.gif';
return "$img="$url" data-href="$src" ";
}
Slike u WordPress-u - LakoTuts
• Filtrirati slike prilikom ispisa
– add_filter(‘the_content’, ‘funkcija za filtriranje slika’)
• CSS:
– .post img {max-width:100%;height:auto;}
$attachment_id = lakotuts_get_attachment_id_from_url($header_image);
$image480 = wp_get_attachment_image_src( $attachment_id, 'image480' );
$image768 = wp_get_attachment_image_src( $attachment_id, 'image768' );
$image1024 = wp_get_attachment_image_src( $attachment_id, 'image1024' );
$image1920 = wp_get_attachment_image_src( $attachment_id, 'image1920' );
echo ‘ #masthead { background-image: url(''. $image768[0] .''); } ';
echo '@media (min-width:768px) { #masthead { background-image: url(''. $image768[0] .''); }}';
echo '@media (min-width:1024px) { #masthead { background-image: url(''. $image1024[0] .''); }}';
echo '@media (min-width:1200px) { #masthead { background-image: url(''. $image1920[0] .''); }}';
WordPress Mobile
• wp_mobile()
• WURFL baza podataka
• github.com/jcasabona/wp-ress/
WordPress Mobile
function wpr_detect_mobile_device(){
try{
$config = new WurflCloud_Client_Config();
$config->api_key = WPR_API_KEY;
$client = new WurflCloud_Client_Client($config);
$client->detectDevice();
return $client->getDeviceCapability('is_wireless_device');
}
catch (Exception $e){
return wp_is_mobile();
}
}
define('WPR_IS_MOBILE', wpr_detect_mobile_device());
WordPress Mobile
• Izbornici za Desktop i Mobitele/Tablete
– Izbjegnut dvostruki HTML sadržaj
• Prikaz pojedinog sadržaja samo na zahtjev
– Komentari
– Sidebar
Pitanja
?

More Related Content

What's hot

Be German About Your Frontend
Be German About Your FrontendBe German About Your Frontend
Be German About Your FrontendArush Sehgal
 
Front-end Rails-приложений приложений, основанный на БЭМ
Front-end Rails-приложений приложений, основанный на БЭМFront-end Rails-приложений приложений, основанный на БЭМ
Front-end Rails-приложений приложений, основанный на БЭМАлександр Ежов
 
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...RobotDeathSquad
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Marc Grabanski
 
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)Future Insights
 
Tide - The missing web framework
Tide - The missing web frameworkTide - The missing web framework
Tide - The missing web frameworkEsteban Lorenzano
 
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartBest Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartScott DeLoach
 
Sadielai10x10presentation
Sadielai10x10presentationSadielai10x10presentation
Sadielai10x10presentationsadielai
 
Thinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS LayoutsThinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS Layoutsdjesse
 
Introduction to Web Design, Week 1
Introduction to Web Design, Week 1Introduction to Web Design, Week 1
Introduction to Web Design, Week 1Lou Susi
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web componentsJarrod Overson
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UIPaul Bakaus
 
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JSWordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JSDavid Bisset
 
Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Holger Bartel
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuerykatbailey
 

What's hot (20)

Be German About Your Frontend
Be German About Your FrontendBe German About Your Frontend
Be German About Your Frontend
 
Front-end Rails-приложений приложений, основанный на БЭМ
Front-end Rails-приложений приложений, основанный на БЭМFront-end Rails-приложений приложений, основанный на БЭМ
Front-end Rails-приложений приложений, основанный на БЭМ
 
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
 
Css3
Css3Css3
Css3
 
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
 
Tide - The missing web framework
Tide - The missing web frameworkTide - The missing web framework
Tide - The missing web framework
 
Fundamental JQuery
Fundamental JQueryFundamental JQuery
Fundamental JQuery
 
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartBest Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
 
Sadielai10x10presentation
Sadielai10x10presentationSadielai10x10presentation
Sadielai10x10presentation
 
Thinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS LayoutsThinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS Layouts
 
Introduction to Web Design, Week 1
Introduction to Web Design, Week 1Introduction to Web Design, Week 1
Introduction to Web Design, Week 1
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UI
 
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JSWordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JS
 
Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015
 
Sami world travel
Sami world travelSami world travel
Sami world travel
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 

Viewers also liked

Instalacija i podešavanje word press bloga
Instalacija i podešavanje word press blogaInstalacija i podešavanje word press bloga
Instalacija i podešavanje word press blogaKruno Klukovic
 
WordPress za početnike
WordPress za početnikeWordPress za početnike
WordPress za početnikeDejanVesic
 
Projektovanje web aplikacija
Projektovanje web aplikacijaProjektovanje web aplikacija
Projektovanje web aplikacijaDamjan Pavlica
 
WordPress teme za početnike - uvod u Theme Development
WordPress teme za početnike - uvod u Theme DevelopmentWordPress teme za početnike - uvod u Theme Development
WordPress teme za početnike - uvod u Theme DevelopmentIvan Percan
 
Wordpress - Sistem za upravljanje sadržajem na webu
Wordpress - Sistem za upravljanje sadržajem na webuWordpress - Sistem za upravljanje sadržajem na webu
Wordpress - Sistem za upravljanje sadržajem na webuMilan Stošić
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7julien pauli
 
Uvod u funkcionalno programiranje
Uvod u funkcionalno programiranjeUvod u funkcionalno programiranje
Uvod u funkcionalno programiranjeDamjan Pavlica
 
Uvod u objektno orijentisano programiranje i C++
Uvod u objektno orijentisano programiranje i C++Uvod u objektno orijentisano programiranje i C++
Uvod u objektno orijentisano programiranje i C++Damjan Pavlica
 
Uvod u softversko inženjerstvo
Uvod u softversko inženjerstvoUvod u softversko inženjerstvo
Uvod u softversko inženjerstvoDamjan Pavlica
 

Viewers also liked (12)

Instalacija i podešavanje word press bloga
Instalacija i podešavanje word press blogaInstalacija i podešavanje word press bloga
Instalacija i podešavanje word press bloga
 
WordPress za početnike
WordPress za početnikeWordPress za početnike
WordPress za početnike
 
Šta je Bootstrap?
Šta je Bootstrap?Šta je Bootstrap?
Šta je Bootstrap?
 
Projektovanje web aplikacija
Projektovanje web aplikacijaProjektovanje web aplikacija
Projektovanje web aplikacija
 
WordPress teme za početnike - uvod u Theme Development
WordPress teme za početnike - uvod u Theme DevelopmentWordPress teme za početnike - uvod u Theme Development
WordPress teme za početnike - uvod u Theme Development
 
Wordpress - Sistem za upravljanje sadržajem na webu
Wordpress - Sistem za upravljanje sadržajem na webuWordpress - Sistem za upravljanje sadržajem na webu
Wordpress - Sistem za upravljanje sadržajem na webu
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7
 
Starenje softvera
Starenje softveraStarenje softvera
Starenje softvera
 
Uvod u funkcionalno programiranje
Uvod u funkcionalno programiranjeUvod u funkcionalno programiranje
Uvod u funkcionalno programiranje
 
Refaktorisanje
RefaktorisanjeRefaktorisanje
Refaktorisanje
 
Uvod u objektno orijentisano programiranje i C++
Uvod u objektno orijentisano programiranje i C++Uvod u objektno orijentisano programiranje i C++
Uvod u objektno orijentisano programiranje i C++
 
Uvod u softversko inženjerstvo
Uvod u softversko inženjerstvoUvod u softversko inženjerstvo
Uvod u softversko inženjerstvo
 

Similar to Responsive Web Design tehnike u WordPress-u

以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角Mei-yu Chen
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaChris Scott
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版Joseph Chiang
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsSven Wolfermann
 
CSS and image optimization
CSS and image optimizationCSS and image optimization
CSS and image optimizationStoyan Stefanov
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassClaudina Sarahe
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용NAVER D2
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)Beau Lebens
 
Drupal as a web framework
Drupal as a web frameworkDrupal as a web framework
Drupal as a web frameworkAdam Kalsey
 

Similar to Responsive Web Design tehnike u WordPress-u (20)

以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角
 
Word Press As A Cms
Word Press As A CmsWord Press As A Cms
Word Press As A Cms
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side Components
 
CSS and image optimization
CSS and image optimizationCSS and image optimization
CSS and image optimization
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Rails3 asset-pipeline
Rails3 asset-pipelineRails3 asset-pipeline
Rails3 asset-pipeline
 
125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용
 
Membuat slide show pada posting
Membuat slide show pada postingMembuat slide show pada posting
Membuat slide show pada posting
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLs
 
Drupal as a web framework
Drupal as a web frameworkDrupal as a web framework
Drupal as a web framework
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Responsive Web Design tehnike u WordPress-u

  • 1. Responsive Web Design tehnike u WordPressu Igor Benić WP Meetup Zagreb 19.09
  • 2. Sadržaj • O meni • Što je RWD? • Izrada RWD-a • Slike u RWD-u • WordPress i RWD • Slike u WordPress-u • WordPress Mobile • Pitanja
  • 3. O meni • Front End Developer @ Multilink • Co-founder – www.lakotuts.com • PSD -> PHP • Autor knjige: WordPress na Bootstrap-u 3.x
  • 4. O meni • Bootstrap 3 • Izrada osnovne i naprednih tema • Customizer API • Settings API • AJAX http://leanpub.com/wpb3
  • 5. Što je RWD? • Stranica (sadržaj) se prilagođava ekranu – Točke izmjene • Vrste RWD-a – Responsive – Adaptive • Sadržaj • Brzina
  • 6. Izrada RWD-a • Mobile First • Desktop First • Korištenje Alata • CSS od nule • Korištenje Frameworka
  • 7. Načini izrade - Framework • Bootstrap 3 • Foundation • Skeleton • Gumby • Mnogi drugi
  • 8. Slike u RWD-u • Nisu jednostavne – Servirati samo potrebnu sliku – Paziti i na Retina ekrane • Moguća rješenja – Picturefill 2.0 – BttrLazyLoading
  • 9. Slike u RWD-u – PictureFill 2.0 <picture> <!--[if IE 9]><video style="display: none;"><![endif]--> <source srcset="examples/images/extralarge.jpg" media="(min- width: 1000px)"> <source srcset="examples/images/large.jpg" media="(min-width: 800px)"> <source srcset="examples/images/large@2.jpg" media="(min- width: 800px) and (-webkit-min-device-pixel-ratio: 2)"> <!--[if IE 9]></video><![endif]--> <img srcset="examples/images/medium.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia"> </picture>
  • 10. Slike u RWD-u – BttrLazyLoading <img id="yourImageId" class="bttrlazyloading" data-bttrlazyloading-xs-src="img/768x200.gif" data-bttrlazyloading-xs-width="768" data-bttrlazyloading-xs-height="200" data-bttrlazyloading-sm-src="img/345x250.gif" data-bttrlazyloading-sm-width="345" data-bttrlazyloading-sm-height="250" data-bttrlazyloading-md-src="img/455x350.gif" data-bttrlazyloading-md-width="455" data-bttrlazyloading-md-height="350" d data-bttrlazyloading-lg-src="img/360x300.gif" data-bttrlazyloading-lg-width="360" data-bttrlazyloading-lg-height="300" />
  • 11. WordPress i RWD RESS Pružanje sadržaja ovisno o uređaju Prilagodba sadržaja na serveru
  • 12. Slike u WordPress-u • Različite verzije za istu sliku – add_image_size(“verzija”, širina, visina, [true | false]); • add_filter(“post_thumbnail”, funkcija_za_promjenu);
  • 13. Slike u WordPress-u - Thumbnailovifunction wpb3_thumbnail_html($html, $post_id, $aid, $sizeThumb, $attr){ if($sizeThumb == "slika-clanka"){ $sizes = array('slika-clanka‘, 'slika-clanka-md‘, 'slika-clanka-sm‘, 'slika-clanka-xs’); $img = "<img class='bttrLazyLoading img-responsive' alt='".get_the_title()."'"; $sizeBttr = ""; $width = ""; $height = ""; $aid = (!$aid) ? get_post_thumbnail_id() : $aid; foreach ( $sizes as $size ) { $url = wp_get_attachment_image_src( $aid, $size ); switch ($size) { case 'slika-clanka': $sizeBttr = "lg"; $width = "750"; $height= "353"; break; ... } $img .= " data-bttrlazyloading-".$sizeBttr."-src='". $url[0] ."' "; $img .= " data-bttrlazyloading-".$sizeBttr."-width='". $width ."' "; $img .= " data-bttrlazyloading-".$sizeBttr."-height='". $height ."' "; } $img .= " />"; return $img; } return $html; } add_filter( 'post_thumbnail_html', 'wpb3_thumbnail_html', 10, 5);
  • 14. Slike u WordPress-u - Content • Filtrirati slike prilikom ispisa ili obrisati (na mobitelima) – add_filter(‘the_content’, ‘funkcija za filtriranje slika’) • CSS: – .post img {max-width:100%;height:auto;} function slike_u_content() { global $post; $html = preg_replace_callback( '#(<imgs[^>]*src)="([^"]+)"#', "callback_img", get_the_content($post->ID) ); return $html; } function callback_img($match) { list(, $img, $src) = $match; $url = get_stylesheet_directory_uri().'/img_placeholder.gif'; return "$img="$url" data-href="$src" "; }
  • 15. Slike u WordPress-u - LakoTuts • Filtrirati slike prilikom ispisa – add_filter(‘the_content’, ‘funkcija za filtriranje slika’) • CSS: – .post img {max-width:100%;height:auto;} $attachment_id = lakotuts_get_attachment_id_from_url($header_image); $image480 = wp_get_attachment_image_src( $attachment_id, 'image480' ); $image768 = wp_get_attachment_image_src( $attachment_id, 'image768' ); $image1024 = wp_get_attachment_image_src( $attachment_id, 'image1024' ); $image1920 = wp_get_attachment_image_src( $attachment_id, 'image1920' ); echo ‘ #masthead { background-image: url(''. $image768[0] .''); } '; echo '@media (min-width:768px) { #masthead { background-image: url(''. $image768[0] .''); }}'; echo '@media (min-width:1024px) { #masthead { background-image: url(''. $image1024[0] .''); }}'; echo '@media (min-width:1200px) { #masthead { background-image: url(''. $image1920[0] .''); }}';
  • 16. WordPress Mobile • wp_mobile() • WURFL baza podataka • github.com/jcasabona/wp-ress/
  • 17. WordPress Mobile function wpr_detect_mobile_device(){ try{ $config = new WurflCloud_Client_Config(); $config->api_key = WPR_API_KEY; $client = new WurflCloud_Client_Client($config); $client->detectDevice(); return $client->getDeviceCapability('is_wireless_device'); } catch (Exception $e){ return wp_is_mobile(); } } define('WPR_IS_MOBILE', wpr_detect_mobile_device());
  • 18. WordPress Mobile • Izbornici za Desktop i Mobitele/Tablete – Izbjegnut dvostruki HTML sadržaj • Prikaz pojedinog sadržaja samo na zahtjev – Komentari – Sidebar