This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul> | |
| <?php | |
| global $post; | |
| $args = array( 'post_type' => 'portfolio', 'numberposts' => 4, 'orderby' => 'rand'); $tmp_post = $post; | |
| $myposts = get_posts( $args ); | |
| foreach( $myposts as $post ) : setup_postdata($post); ?> | |
| <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> | |
| <?php endforeach; | |
| $post = $tmp_post; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*for parent div*/ | |
| .myvideo { | |
| position:relative; | |
| margin: 20px 0; | |
| padding-bottom:56.25%; | |
| padding-top:30px; | |
| height:0; | |
| overflow:hidden; | |
| border:1px solid #ccc; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Ограничение длины строки | |
| public function truncString($pageId, $propName, $limit, $pTag = 0) { | |
| $hierarchy = umiHierarchy::getInstance(); | |
| $page = $hierarchy->getElement($pageId); | |
| if ($page === false) | |
| return ""; | |
| $propVal = $page->getValue($propName); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // правим файл classes/modules/custom.php | |
| class custom extends def_module { | |
| public function cms_callMethod($method_name, $args) { | |
| return call_user_func_array(Array($this, $method_name), $args); | |
| } | |
| public function __call($method, $args) { | |
| throw new publicException("Method " . get_class($this) . "::" . $method . " doesn't exists"); | |
| } | |
| //TODO: Write your own macroses here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>test</title> | |
| <link rel="stylesheet" href="stylesheets/screen.css"> | |
| </head> | |
| <body> | |
| <div class="container c1"></div> | |
| <div class="container c2"></div> |
NewerOlder