Tuesday, November 1, 2016

@mixin square($size,$color:black){ width:$size; height:$size; border: 1px solid $color; } 

.box{ @include square($color:red,$size:10px); }
 @mixin rainbow($colors...) { @each $color in $colors { .#{$color} { background: $color; } } }

Monday, October 31, 2016

mixin

/* Write your SCSS code below. */
@mixin button ($color,$size)
{
background:$color;
width:$size;
height:$size/2;
}

.menu_button{
@include button(#369,50px)
}

/* Write your SCSS code below. */
%animals {
    background: #369;
}
.animals {
    @extend %animals;
}
.dogs {
    @extend %animals;
}
%super_link {
  font-weight: bold;
  color: red;          
}

/* Write your SCSS code below. */
@function double ($input){
   @return $input * 2 ;
   }

div {
  font-size: unquote(double(5) + "px");
}

/* Write your SCSS code below. */
@media screen and (orientation:landscape) {
    img {
    width: 360px;
  }
}

ul#menu {
    li {
    @media screen and (max-width: 500px) {
        text-align: center;
    }
  }
}

@mixin cars($make, $color) {
        .#{$make} {
            border: 1px solid black;
        background-image: url("#{$color}.png");
   }
}

$time: morning;
a {
  @if $time == morning {
    color: red;
  } @else if $time == afternoon {
    color: blue;
  } @else {
    color: grey;
  }
}

select 1 to 3
@for $i from 1 through 3 { .item_#{$i} { width: $i * 100px; } }
@each $color in red, blue, green {
  .#{$color}_box {
    background-color: $color;
  }

@each $num in 1, 2, 3, 4, 5 { // a list of numbers
  // your code here
}

@each $num in 1 2 3 4 5 { // also a list of numbers
  // your code here
}

@for $num from 1 through 5 { // a range
  // your code here
}

@for $num from 1 to 6 { // also a range, and equivalent to the one above
  // your code here
}
}

Saturday, September 3, 2016

[vc_row full_width="stretch_row" el_class="margin_top_xlarge margin_bottom_xmedium"][vc_column width="1/2"][vc_column_text el_class="bgtext1"]FEATURED[/vc_column_text][trx_title subtitle="Dartmouth, MA 02748" type="2" style="iconed" icon="icon-map-pointer18" class="ind2" top="null" bottom="xmedium"]<a href="/?p=352">87 Mishaum Point Rd,</a>[/trx_title][trx_block dedicated="no" pan="no" scroll="no" bg_overlay="0" bg_texture="0" font_size="1.286em" font_line_height="1.667em" font_weight="100" bottom="xmedium"][vc_column_text]On the best lot at Phuket is situated the Kailua Residence. It features Ipe hardwood flooring on the interior and granite stone flooring on the lanais, high vaulted cedar ceilings.[/vc_column_text][/trx_block][trx_columns fluid="no" bottom="medium"][trx_column_item][trx_list style="iconed" color="#999ca9" icon="icon-stop" icon_color="#ef595a"][trx_list_item][vc_column_text]Quiet Neighbourhood[/vc_column_text][/trx_list_item][trx_list_item][vc_column_text]Great Local Community[/vc_column_text][/trx_list_item][/trx_list][/trx_column_item][trx_column_item][trx_list style="iconed" color="#999ca9" icon="icon-stop" icon_color="#ef595a"][trx_list_item][vc_column_text]Fabulous Views[/vc_column_text][/trx_list_item][trx_list_item][vc_column_text]Large Play Center In Yard[/vc_column_text][/trx_list_item][/trx_list][/trx_column_item][/trx_columns][trx_property style="property-2" cat="0" columns="1" count="1" ids="352"][/trx_property][/vc_column][vc_column width="1/2"][trx_image url="32" link="/?p=352" width="570" height="414"][/vc_column][/vc_row][vc_row full_width="stretch_row" css=".vc_custom_1455702537736{background-color: #f0f1f5 !important;}"][vc_column][trx_content top="large" bottom="medium"][trx_title type="4" top="null" bottom="medium"]recent properties[/trx_title][trx_property custom="no"][/trx_property][/trx_content][/vc_column][/vc_row][vc_row full_width="stretch_row" parallax="content-moving" parallax_image="47"][vc_column][trx_block dedicated="no" pan="no" scroll="no" dark_bg="yes" bg_overlay="0" bg_texture="0"][trx_services custom="no"][/trx_services][/trx_block][/vc_column][/vc_row][vc_row full_width="stretch_row" css=".vc_custom_1455703900863{background-image: url(http://estate.dv.axiomthemes.com/wp-content/uploads/img_bg01.png?id=837) !important;background-position: center !important;background-repeat: no-repeat !important;background-size: cover !important;}" el_class="mobile-box"][vc_column][vc_column_text el_class="bgtext1"]MOBILE[/vc_column_text][trx_columns][trx_column_item][trx_title]Search Best Deals <b>on Go</b>[/trx_title][trx_block dedicated="no" pan="no" scroll="no" bg_overlay="0" bg_texture="0" font_size="1.286em" font_line_height="1.667em" font_weight="100" bottom="medium"][vc_column_text]The best deals available today for our consumers. We have the best local professionals who can help you. We are the leading real estate and rental marketplace![/vc_column_text][/trx_block][trx_block dedicated="no" pan="no" scroll="no" dark_bg="no" bg_overlay="0" bg_texture="0"][trx_image url="http://estate.dv.axiomthemes.com/wp-content/uploads/img_b1.png" align="left" link="#"][trx_image url="http://estate.dv.axiomthemes.com/wp-content/uploads/img_b2.png" align="left" link="#" bottom="large"][/trx_block][/trx_column_item][trx_column_item][trx_image url="845" class="customImgHome1"][/trx_column_item][/trx_columns][/vc_column][/vc_row][vc_row css=".vc_custom_1454433956651{background-image: url(http://estate.dv.axiomthemes.com/wp-content/uploads/image-16.jpg?id=204) !important;background-position: center !important;background-repeat: no-repeat !important;background-size: cover !important;}"][vc_column][trx_gap][trx_testimonials style="testimonials-2" controls="pagination" autoheight="yes" custom="no" bg_overlay="0" bg_texture="0" class="scheme_dark"][/trx_testimonials][/trx_gap][/vc_column][/vc_row]

Friday, September 2, 2016

wp retreving custom post loop


accepted
$loop = new WP_Query( array( 
    'post_type' => 'portfolio', 
    'cat' => 5, // Whatever the category ID is for your aerial category
    'posts_per_page' => 10,
    'orderby' => 'date', // Purely optional - just for some ordering
    'order' => 'DESC' // Ditto
) );

while ( $loop->have_posts() ) : $loop->the_post(); ?>
Couple of things to consider as well :
1) is your custom post type registered to use the built in categories or is it a custom taxonomy that it's using? If the former then the above should work, if the latter then you would need to use 'your-taxonomy-name'=>'your-taxonomy-term' in place of the cat=>5 parameter
2) Do you have any other loops running on the page? If so they will need
<?php wp_reset_query(); ?>
after them in order for subsequent loops 

wp retreving custom post loop


accepted
$loop = new WP_Query( array( 
    'post_type' => 'portfolio', 
    'cat' => 5, // Whatever the category ID is for your aerial category
    'posts_per_page' => 10,
    'orderby' => 'date', // Purely optional - just for some ordering
    'order' => 'DESC' // Ditto
) );

while ( $loop->have_posts() ) : $loop->the_post(); ?>
Couple of things to consider as well :
1) is your custom post type registered to use the built in categories or is it a custom taxonomy that it's using? If the former then the above should work, if the latter then you would need to use 'your-taxonomy-name'=>'your-taxonomy-term' in place of the cat=>5 parameter
2) Do you have any other loops running on the page? If so they will need
<?php wp_reset_query(); ?>
after them in order for subsequent loops 

Tuesday, August 23, 2016

search 'en' into a string php

<?php  $uri = $_SERVER['REQUEST_URI']; // or taken from another source //
if( strpos($uri, 'en') !== false ){
   // Your action goes here! //
   echo "A place for everything and all in its place";
} else { echo "Un loc pentru toate si toate la locul lor"; }
 ?>

Thursday, August 4, 2016

function create_post_type wp

function create_post_type() {
    register_post_type( 'product',
        array(
            'labels' => array(
                'name' => __( 'Products' ),
                'singular_name' => __( 'Product' )
            ),
        'public' => true,
        'has_archive' => true,
        'exclude_from_search' => true,
        'show_ui' => true,
        'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),
        )
    );
}
add_action( 'init', 'create_post_type' );

function my_taxonomies_product() {
    $labels = array(
        'name'              => _x( 'Product Categories', 'taxonomy general name' ),
        'singular_name'     => _x( 'Product Category', 'taxonomy singular name' ),
        'search_items'      => __( 'Search Product Categories' ),
        'all_items'         => __( 'All Product Categories' ),
        'parent_item'       => __( 'Parent Product Category' ),
        'parent_item_colon' => __( 'Parent Product Category:' ),
        'edit_item'         => __( 'Edit Product Category' ), 
        'update_item'       => __( 'Update Product Category' ),
        'add_new_item'      => __( 'Add New Product Category' ),
        'new_item_name'     => __( 'New Product Category' ),
        'menu_name'         => __( 'Product Categories' ),
    );
    $rewrite = array(
        'slug' => 'type',
        'with_front' => true,
        'hierarchical' => true,
    );
    $args = array(
        'labels' => $labels,
        'hierarchical' => true,
        'rewrite' => $rewrite,
    );
    register_taxonomy( 'product_category', 'product', $args );
}
add_action( 'init', 'my_taxonomies_product', 0 );