sos PHP
by GosiaPi
HTML
//------------------------link w a, przechodzenie do innego page -------------------------------------------------
<?php echo get_permalink(get_page_by_path('our-work')) ?>
//------------------------pobiera sciezke do stylesheet-----------------------------------------------------------
<img src="<?php echo get_stylesheet_directory_uri() ?>/svg/arrow-left-white.svg"></img>
//------------------------ustawianie background image za pomoca feature image ------------------------------------
<div class="container" style="background-image: url('<?php echo get_the_post_thumbnail_url($post) ?>')">
//------------------------pobiera content z custom fielda --------------------------------------------------------
<?php the_field('sub_header') ?>
//------------------------pobierz kod z partial ------------------------------------------------------------------
<?php get_template_part("partials/partial", "apply")?>
("nazwa folderu/poczatek pliku" , "nazwa pliku")
//-------------------------pobierz tekst wp-editor default (bez pustych p) --------------------------------------
<?php echo wpautop($post->post_content) ?>
//------------------------RELATIONSHIP: pobiera z jedno pole ----------------------------------------------------
<?php echo get_permalink( $job->ID ); ?>
//------------------------RELATIONSHIP: pobieranie nazwy page-----------------------------------------------------
<?php echo get_the_title( $job->ID ); ?>
//------------------------RELATIONSHIP: przykład------------------------------------------------------------------
<ul class="list">
<?php
$jobs = get_field('openings');
if ( !empty($jobs) ) : ?>
<?php foreach ($jobs as $job) : ?>
<li>
<a href="<?php echo get_permalink( $job->ID ); ?>"><?php echo get_the_title( $job->ID ); ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
//-----------------------WIDGET: dodawanie----------------------------------------------------------------------
//functions
<?php...
CSS
// USAGE: @include display-flex();
@mixin display-flex() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
// USAGE: @include align-items($align-items);
@mixin align-items($align-items) {
-webkit-box-align: $align-items;
-ms-flex-align: $align-items;
align-items: $align-items;
}
// USAGE: @include align-self(center);
@mixin align-self($align-self) {
align-items: $align-self;
-webkit-align-self: $align-self;
}
// USAGE: @include flex-direction(row)
@mixin flex-direction($flex-direction) {
-webkit-box-orient: $flex-direction;
-webkit-box-direction: $flex-direction;
-ms-flex-direction: $flex-direction;
flex-direction: $flex-direction;
}
// USAGE: @include justify-content(space-between);
@mixin justify-content($justify-content) {
justify-content: $justify-content;
-webkit-justify-content: $justify-content;
-moz-justify-content: $justify-content;
}
// USAGE: @include background-size(cover);
@mixin background-size($background-size) {
background-size: $background-size;
-webkit-background-size: $background-size;
-moz-background-size: $background-size;
-o-background-size: $background-size;
}
// USAGE: @include transform(scaleX(-1) translateY(-50%))
@mixin transform($value) {
-webkit-transform: $value;
-moz-transform: $value;
-ms-transform: $value;
-o-transform: $value;
transform: $value;
}
// USAGE: @include animation('slide-down 5s 3');
@mixin keyframes($animation-name) {
@-webkit-keyframes #{$animation-name} {
@content;
}
@-moz-keyframes #{$animation-name} {
@content;
}
@-ms-keyframes #{$animation-name} {
@content;
}
@-o-keyframes #{$animation-name} {
@content;
}
@keyframes #{$animation-name} {
@content;
}
}
// USAGE: @include transition(color .3s ease);
//USAGE: @include transition(.3s);
@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
-ms-transition: $args;
-o-transition:...
JavaScript
@import 'mixins';
// VARIABLES
@import 'variables/colors';
@import 'variables/typography';
//LAYOUT
@import 'layout/brands';
// MODULE
@import 'module/page-head';
@import 'module/page-head-fullsize';
@import 'module/share-section';
//PAGES
@import 'pages/home';
@import 'pages/global-view';
@import 'pages/brands-single';
@import 'pages/pages';
//LAYOUT
@import 'layout/header';
@import 'layout/footer';