У Вас наверно возник вопрос: Что же такое кастомный пост тайп (custom post type) или произвольный тип записи? Если простыми словами это некое подобие таблицы в базе данных.
К примеру записи(посты) или страницы это стандартные пост тайпы WordPress.
В SP Framework для создания кастомного пост тайпа есть класс SP_Framework_Post_Type
Давайте приступим к созданию пост тайпов.
1. Для начала проанализирую главную страницу нашего тестового сайта. Зададим себе вопрос: Что можно вынести в пост тайп?
Ответ простой, это первый экран где у нас слайдер, потом секция с протфолио и секция с партнерами.
Фронт работы определен. Осталось подготовить шаблон главной страницы. В SP Theme уже есть файл front-page-template.php. Добавим туда верстку.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
<?php /* Template Name: Front page */ get_header(); ?> <section id="slider" class="slider-element slider-parallax swiper_wrapper full-screen clearfix"> <div class="slider-parallax-inner"> <div class="swiper-container swiper-parent"> <div class="swiper-wrapper"> <div class="swiper-slide dark" style="background-image: url('images/slider/1.jpg');"> <div class="slider-content"> <div class="container clearfix"> <div class="slider-caption slider-caption-center"> <h2 data-animate="fadeInUp">Slide 1</h2> <p class="d-none d-sm-block" data-animate="fadeInUp" data-delay="200">Create just what you need for your Perfect Website. Choose from a wide range of Elements & simply put them on your own Canvas.</p> </div> </div> </div> </div> <div class="swiper-slide dark" style="background-image: url('images/slider/2.jpg');"> <div class="slider-content"> <div class="container clearfix"> <div class="slider-caption slider-caption-center"> <h2 data-animate="fadeInUp">Slide 2</h2> <p class="d-none d-sm-block" data-animate="fadeInUp" data-delay="200">Create just what you need for your Perfect Website. Choose from a wide range of Elements & simply put them on your own Canvas.</p> </div> </div> </div> </div> </div> <div class="slider-arrow-left"><i class="icon-angle-left"></i></div> <div class="slider-arrow-right"><i class="icon-angle-right"></i></div> </div> <a href="#" data-scrollto="#content" data-offset="100" class="dark one-page-arrow"><i class="icon-angle-down infinite animated fadeInDown"></i></a> </div> </section> <!-- Content ============================================= --> <section id="content"> <div class="content-wrap"> <div class="container clearfix"> <div class="row clearfix"> <div class="col-xl-5"> <div class="heading-block topmargin"> <h1>About Our Company</h1> </div> <p class="lead">Create a website that you are gonna be proud of. Be it Business, Portfolio, Agency, Photography, eCommerce & much more.</p> </div> <div class="col-xl-7"> <div class="ohidden" data-height-xl="426" data-height-lg="567" data-height-md="470" data-height-md="287" data-height-xs="183"> <img src="images/about.jpg" style="position: absolute; top: 0; left: 0;" data-animate="fadeInUp" data-delay="100" alt="About"> </div> </div> </div> </div> <div class="section nobottommargin"> <div class="container clear-bottommargin clearfix"> <div class="row topmargin-sm clearfix"> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-screen-desktop inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Scalable on Devices.</span> <h4>Responsive & Retina</h4> </div> <p>Employment respond committed meaningful fight against oppression social challenges rural legal aid governance. Meaningful work, implementation, process cooperation, campaign inspire.</p> </div> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-energy inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Smartly Coded & Maintained.</span> <h4>Powerful Performance</h4> </div> <p>Medecins du Monde Jane Addams reduce child mortality challenges Ford Foundation. Diversification shifting landscape advocate pathway to a better life rights international. Assessment.</p> </div> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-equalizer inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Flexible & Customizable.</span> <h4>Truly Multi-Purpose</h4> </div> <p>Democracy inspire breakthroughs, Rosa Parks; inspiration raise awareness natural resources. Governance impact; transformative donation philanthropy, respect reproductive.</p> </div> </div> </div> </div> <div class="row clearfix align-items-stretch bottommargin-lg"> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #515875;"> <i class="i-plain i-xlarge divcenter icon-line2-directions"></i> <div class="counter counter-lined"><span data-from="100" data-to="846" data-refresh-interval="50" data-speed="2000"></span>K</div> <h5>Lines of Codes</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #576F9E;"> <i class="i-plain i-xlarge divcenter icon-line2-graph"></i> <div class="counter counter-lined"><span data-from="3000" data-to="21500" data-refresh-interval="100" data-speed="2500"></span></div> <h5>KBs of HTML Files</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #6697B9;"> <i class="i-plain i-xlarge divcenter icon-line2-layers"></i> <div class="counter counter-lined"><span data-from="10" data-to="408" data-refresh-interval="25" data-speed="3500"></span></div> <h5>No. of Templates</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #88C3D8;"> <i class="i-plain i-xlarge divcenter icon-line2-clock"></i> <div class="counter counter-lined"><span data-from="60" data-to="1400" data-refresh-interval="30" data-speed="2700"></span></div> <h5>Hours of Coding</h5> </div> </div> <div class="container clearfix"> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn"> <div class="fbox-icon"> <a href="#"><i class="icon-line-monitor"></i></a> </div> <h3>Responsive Layout</h3> <p>Powerful Layout with Responsive functionality that can be adapted to any screen size.</p> </div> </div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="200"> <div class="fbox-icon"> <a href="#"><i class="icon-line-eye"></i></a> </div> <h3>Retina Ready Graphics</h3> <p>Looks beautiful & ultra-sharp on Retina Displays with Retina Icons, Fonts & Images.</p> </div> </div> <div class="col_one_third col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="400"> <div class="fbox-icon"> <a href="#"><i class="icon-line-star"></i></a> </div> <h3>Powerful Performance</h3> <p>Optimized code that are completely customizable and deliver unmatched fast performance.</p> </div> </div> <div class="clear"></div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="600"> <div class="fbox-icon"> <a href="#"><i class="icon-line-play"></i></a> </div> <h3>HTML5 Video</h3> <p>Canvas provides support for Native HTML5 Videos that can be added to a Full Width Background.</p> </div> </div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="800"> <div class="fbox-icon"> <a href="#"><i class="icon-params"></i></a> </div> <h3>Parallax Support</h3> <p>Display your Content attractively using Parallax Sections that have unlimited customizable areas.</p> </div> </div> <div class="col_one_third col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="1000"> <div class="fbox-icon"> <a href="#"><i class="icon-line-circle-check"></i></a> </div> <h3>Endless Possibilities</h3> <p>Complete control on each & every element that provides endless customization possibilities.</p> </div> </div> <div class="clear"></div> <div class="col_one_third bottommargin-sm"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="600"> <div class="fbox-icon"> <a href="#"><i class="icon-bulb"></i></a> </div> <h3>Light & Dark Color Schemes</h3> <p>Change your Website's Primary Scheme instantly by simply adding the dark class to the body.</p> </div> </div> <div class="col_one_third bottommargin-sm"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="800"> <div class="fbox-icon"> <a href="#"><i class="icon-heart2"></i></a> </div> <h3>Boxed & Wide Layouts</h3> <p>Stretch your Website to the Full Width or make it boxed to surprise your visitors.</p> </div> </div> <div class="col_one_third bottommargin-sm col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="1000"> <div class="fbox-icon"> <a href="#"><i class="icon-note"></i></a> </div> <h3>Extensive Documentation</h3> <p>We have covered each & everything in our Documentation including Videos & Screenshots.</p> </div> </div> <div class="clear"></div> </div> <div class="section topmargin nobottommargin nobottomborder"> <div class="container clearfix"> <div class="heading-block center nomargin"> <h3>Our Latest Works</h3> </div> </div> </div> <div id="portfolio" class="portfolio portfolio-nomargin grid-container portfolio-notitle portfolio-full grid-container clearfix"> <article class="portfolio-item pf-media pf-icons"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/1.jpg" alt="Open Imagination"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Open Imagination</a></h3> <span><a href="#">Media</a>, <a href="#">Icons</a></span> </div> </article> <article class="portfolio-item pf-illustrations"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/2.jpg" alt="Locked Steel Gate"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Locked Steel Gate</a></h3> <span><a href="#">Illustrations</a></span> </div> </article> <article class="portfolio-item pf-media pf-icons"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/3.jpg" alt="Open Imagination"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Open Imagination</a></h3> <span><a href="#">Media</a>, <a href="#">Icons</a></span> </div> </article> <article class="portfolio-item pf-illustrations"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/4.jpg" alt="Locked Steel Gate"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Locked Steel Gate</a></h3> <span><a href="#">Illustrations</a></span> </div> </article> <article class="portfolio-item pf-media pf-icons"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/5.jpg" alt="Open Imagination"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Open Imagination</a></h3> <span><a href="#">Media</a>, <a href="#">Icons</a></span> </div> </article> <article class="portfolio-item pf-illustrations"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/6.jpg" alt="Locked Steel Gate"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Locked Steel Gate</a></h3> <span><a href="#">Illustrations</a></span> </div> </article> <article class="portfolio-item pf-media pf-icons"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/7.jpg" alt="Open Imagination"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Open Imagination</a></h3> <span><a href="#">Media</a>, <a href="#">Icons</a></span> </div> </article> <article class="portfolio-item pf-illustrations"> <div class="portfolio-image"> <a href="portfolio-single.html"> <img src="images/portfolio/4/8.jpg" alt="Locked Steel Gate"> </a> <div class="portfolio-overlay"></div> </div> <div class="portfolio-desc"> <h3><a href="portfolio-single.html">Locked Steel Gate</a></h3> <span><a href="#">Illustrations</a></span> </div> </article> </div> <div class="section notopmargin notopborder"> <div class="container clearfix"> <div class="heading-block center nomargin"> <h3>Latest from the Blog</h3> </div> </div> </div> <div class="container clear-bottommargin clearfix"> <div class="row"> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/1.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Bloomberg smart cities; change-makers economic security</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 13th Jun 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 53</a></li> </ul> <div class="entry-content"> <p>Prevention effect, advocate dialogue rural development lifting people up community civil society. Catalyst, grantees leverage.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/2.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Medicine new approaches communities, outcomes partnership</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 24th Feb 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 17</a></li> </ul> <div class="entry-content"> <p>Cross-agency coordination clean water rural, promising development turmoil inclusive education transformative community.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/3.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Significant altruism planned giving insurmountable challenges liberal</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 30th Dec 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 13</a></li> </ul> <div class="entry-content"> <p>Micro-finance; vaccines peaceful contribution citizens of change generosity. Measures design thinking accelerate progress medical initiative.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/4.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Compassion conflict resolution, progressive; tackle</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 15th Jan 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 54</a></li> </ul> <div class="entry-content"> <p>Community health workers best practices, effectiveness meaningful work The Elders fairness. Our ambitions local solutions globalization.</p> </div> </div> </div> </div> </div> <div class="section"> <div class="container clearfix"> <div class="heading-block topmargin-sm center"> <h3>Meet Our Team</h3> </div> <div class="row"> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/3.jpg" alt="John Doe"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>John Doe</h4><span>CEO</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/2.jpg" alt="Josh Clark"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Josh Clark</h4><span>Co-Founder</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/8.jpg" alt="Mary Jane"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Mary Jane</h4><span>Sales</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/4.jpg" alt="Nix Maxwell"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Nix Maxwell</h4><span>Support</span></div> </div> </div> </div> </div> </div> </div> <div class="container clearfix"> <div id="oc-clients" class="owl-carousel image-carousel carousel-widget" data-margin="60" data-loop="true" data-nav="false" data-autoplay="5000" data-pagi="false" data-items-xs="2" data-items-sm="3" data-items-md="4" data-items-lg="5" data-items-xl="6"> <div class="oc-item"><a href="#"><img src="images/clients/1.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/2.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/3.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/4.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/5.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/6.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/7.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/8.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/9.png" alt="Clients"></a></div> <div class="oc-item"><a href="#"><img src="images/clients/10.png" alt="Clients"></a></div> </div> </div> </div> </section><!-- #content end --> <?php get_footer(); |
2. Теперь перейдем к созданию пост тайпов. Для этого добавим следующий код в файл post-types.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
<?php /* * Post Types */ /* * Post Type: sp_slider */ $spSlider = new SP_Framework_Post_Type(); $args = array( 'name' => 'sp_slider', 'slug' => 'sp_slider', 'label' => 'Slider', 'all_items' => 'All', 'add_new' => 'Add', 'add_new_item' => 'Add', 'edit_item' => 'Edit', 'new_item' => 'New', 'view_item' => 'View', 'view_items' => 'View', 'search_items' => 'Search', 'not_found' => 'Not found', 'not_found_in_trash' => 'Not found in trash', 'menu_icon' => 'dashicons-format-image', 'supports' => array('title', 'thumbnail', 'editor'), 'hidden' => 'y', ); $spSlider->create($args); /* * Post Type: sp_protfolio */ $spProtfolio = new SP_Framework_Post_Type(); $args = array( 'name' => 'sp_portfolio', 'slug' => 'sp_portfolio', 'label' => 'Portfolio', 'all_items' => 'All', 'add_new' => 'Add', 'add_new_item' => 'Add', 'edit_item' => 'Edit', 'new_item' => 'New', 'view_item' => 'View', 'view_items' => 'View', 'search_items' => 'Search', 'not_found' => 'Not found', 'not_found_in_trash' => 'Not found in trash', 'menu_icon' => 'dashicons-images-alt2', 'supports' => array('title', 'thumbnail', 'editor'), 'hidden' => 'n', ); $spProtfolio->create($args); /* * Post Type: sp_clients */ $spClients = new SP_Framework_Post_Type(); $args = array( 'name' => 'sp_clients', 'slug' => 'sp_clients', 'label' => 'Clients', 'all_items' => 'All', 'add_new' => 'Add', 'add_new_item' => 'Add', 'edit_item' => 'Edit', 'new_item' => 'New', 'view_item' => 'View', 'view_items' => 'View', 'search_items' => 'Search', 'not_found' => 'Not found', 'not_found_in_trash' => 'Not found in trash', 'menu_icon' => 'dashicons-groups', 'supports' => array('title', 'thumbnail'), 'hidden' => 'y', ); $spClients->create($args); |
3. Осталось настроить вывод данных в публичной части сайта. Для этого сделаем 3 функции, каждая из которой соответствует созданному пост тайпу.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
/* * Front page sections */ function sp_get_slider_section($result=null){ $result .= '<section id="slider" class="slider-element slider-parallax swiper_wrapper full-screen clearfix">'; $result .= '<div class="slider-parallax-inner">'; $result .= '<div class="swiper-container swiper-parent">'; $result .= '<div class="swiper-wrapper">'; $args = array( 'post_type' => 'sp_slider', 'order' => 'asc', ); $spPosts = SP_Framework_Post_Type_Utility::get_list($args); if(count($spPosts)>0){ foreach ($spPosts as $spPost) { $postID = $spPost['id']; $title = $spPost['title']; $content = SP_Framework_Post_Type_Utility::get_content($postID); $image = SP_Framework_Post_Type_Utility::get_image($postID, 'full'); $result .= '<div class="swiper-slide dark" style="background-image: url('.$image.');">'; $result .= '<div class="slider-content">'; $result .= '<div class="container clearfix">'; $result .= '<div class="slider-caption slider-caption-center">'; $result .= '<h2 data-animate="fadeInUp">'.$title.'</h2>'; $result .= '<p class="d-none d-sm-block" data-animate="fadeInUp" data-delay="200">'.$content.'</p>'; $result .= '</div>'; $result .= '</div>'; $result .= '</div>'; $result .= '</div>'; } } $result .= '</div>'; $result .= '<div class="slider-arrow-left"><i class="icon-angle-left"></i></div>'; $result .= '<div class="slider-arrow-right"><i class="icon-angle-right"></i></div>'; $result .= '</div>'; $result .= '<a href="#" data-scrollto="#content" data-offset="100" class="dark one-page-arrow"><i class="icon-angle-down infinite animated fadeInDown"></i></a>'; $result .= '</div>'; $result .= '</section>'; return $result; } function sp_get_portfolio_section($result=null){ $result .= '<div id="portfolio" class="portfolio portfolio-nomargin grid-container portfolio-notitle portfolio-full grid-container clearfix">'; $args = array( 'post_type' => 'sp_portfolio', 'order' => 'asc', ); $spPosts = SP_Framework_Post_Type_Utility::get_list($args); if(count($spPosts)>0){ foreach ($spPosts as $spPost) { $postID = $spPost['id']; $title = $spPost['title']; $url = $spPost['url']; $image = SP_Framework_Post_Type_Utility::get_image($postID, 'full'); $result .= '<article class="portfolio-item pf-media pf-icons">'; $result .= '<div class="portfolio-image">'; $result .= '<a href="'.$url.'">'; $result .= '<img src="'.$image.'" alt="Open Imagination">'; $result .= '</a>'; $result .= '<div class="portfolio-overlay"></div>'; $result .= '</div>'; $result .= '<div class="portfolio-desc">'; $result .= '<h3><a href="'.$url.'">'.$title.'</a></h3>'; $result .= '<span><a href="#">Media</a>, <a href="#">Icons</a></span>'; $result .= '</div>'; $result .= '</article>'; } } $result .= '</div>'; return $result; } function sp_get_clients_section($result=null){ $result .= '<div class="container clearfix">'; $result .= '<div id="oc-clients" class="owl-carousel image-carousel carousel-widget" data-margin="60" data-loop="true" data-nav="false" data-autoplay="5000" data-pagi="false" data-items-xs="2" data-items-sm="3" data-items-md="4" data-items-lg="5" data-items-xl="6">'; $args = array( 'post_type' => 'sp_clients', 'order' => 'asc', ); $spPosts = SP_Framework_Post_Type_Utility::get_list($args); if(count($spPosts)>0){ foreach ($spPosts as $spPost) { $postID = $spPost['id']; $title = $spPost['title']; $content = SP_Framework_Post_Type_Utility::get_content($postID); $image = SP_Framework_Post_Type_Utility::get_image($postID, 'full'); $result .= '<div class="oc-item"><img src="'.$image.'" alt="'.$title.'"></div>'; } } $result .= '</div>'; $result .= '</div>'; return $result; } |
и вызовем их в front-page-template.php.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
<?php /* Template Name: Front page */ get_header(); echo sp_get_slider_section(); ?> <!-- Content ============================================= --> <section id="content"> <div class="content-wrap"> <div class="container clearfix"> <div class="row clearfix"> <div class="col-xl-5"> <div class="heading-block topmargin"> <h1>About Our Company</h1> </div> <p class="lead">Create a website that you are gonna be proud of. Be it Business, Portfolio, Agency, Photography, eCommerce & much more.</p> </div> <div class="col-xl-7"> <div class="ohidden" data-height-xl="426" data-height-lg="567" data-height-md="470" data-height-md="287" data-height-xs="183"> <img src="images/about.jpg" style="position: absolute; top: 0; left: 0;" data-animate="fadeInUp" data-delay="100" alt="About"> </div> </div> </div> </div> <div class="section nobottommargin"> <div class="container clear-bottommargin clearfix"> <div class="row topmargin-sm clearfix"> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-screen-desktop inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Scalable on Devices.</span> <h4>Responsive & Retina</h4> </div> <p>Employment respond committed meaningful fight against oppression social challenges rural legal aid governance. Meaningful work, implementation, process cooperation, campaign inspire.</p> </div> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-energy inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Smartly Coded & Maintained.</span> <h4>Powerful Performance</h4> </div> <p>Medecins du Monde Jane Addams reduce child mortality challenges Ford Foundation. Diversification shifting landscape advocate pathway to a better life rights international. Assessment.</p> </div> <div class="col-lg-4 bottommargin"> <i class="i-plain color i-large icon-line2-equalizer inline-block" style="margin-bottom: 15px;"></i> <div class="heading-block nobottomborder" style="margin-bottom: 15px;"> <span class="before-heading">Flexible & Customizable.</span> <h4>Truly Multi-Purpose</h4> </div> <p>Democracy inspire breakthroughs, Rosa Parks; inspiration raise awareness natural resources. Governance impact; transformative donation philanthropy, respect reproductive.</p> </div> </div> </div> </div> <div class="row clearfix align-items-stretch bottommargin-lg"> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #515875;"> <i class="i-plain i-xlarge divcenter icon-line2-directions"></i> <div class="counter counter-lined"><span data-from="100" data-to="846" data-refresh-interval="50" data-speed="2000"></span>K</div> <h5>Lines of Codes</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #576F9E;"> <i class="i-plain i-xlarge divcenter icon-line2-graph"></i> <div class="counter counter-lined"><span data-from="3000" data-to="21500" data-refresh-interval="100" data-speed="2500"></span></div> <h5>KBs of HTML Files</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #6697B9;"> <i class="i-plain i-xlarge divcenter icon-line2-layers"></i> <div class="counter counter-lined"><span data-from="10" data-to="408" data-refresh-interval="25" data-speed="3500"></span></div> <h5>No. of Templates</h5> </div> <div class="col-lg-3 col-md-6 dark center col-padding" style="background-color: #88C3D8;"> <i class="i-plain i-xlarge divcenter icon-line2-clock"></i> <div class="counter counter-lined"><span data-from="60" data-to="1400" data-refresh-interval="30" data-speed="2700"></span></div> <h5>Hours of Coding</h5> </div> </div> <div class="container clearfix"> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn"> <div class="fbox-icon"> <a href="#"><i class="icon-line-monitor"></i></a> </div> <h3>Responsive Layout</h3> <p>Powerful Layout with Responsive functionality that can be adapted to any screen size.</p> </div> </div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="200"> <div class="fbox-icon"> <a href="#"><i class="icon-line-eye"></i></a> </div> <h3>Retina Ready Graphics</h3> <p>Looks beautiful & ultra-sharp on Retina Displays with Retina Icons, Fonts & Images.</p> </div> </div> <div class="col_one_third col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="400"> <div class="fbox-icon"> <a href="#"><i class="icon-line-star"></i></a> </div> <h3>Powerful Performance</h3> <p>Optimized code that are completely customizable and deliver unmatched fast performance.</p> </div> </div> <div class="clear"></div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="600"> <div class="fbox-icon"> <a href="#"><i class="icon-line-play"></i></a> </div> <h3>HTML5 Video</h3> <p>Canvas provides support for Native HTML5 Videos that can be added to a Full Width Background.</p> </div> </div> <div class="col_one_third"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="800"> <div class="fbox-icon"> <a href="#"><i class="icon-params"></i></a> </div> <h3>Parallax Support</h3> <p>Display your Content attractively using Parallax Sections that have unlimited customizable areas.</p> </div> </div> <div class="col_one_third col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="1000"> <div class="fbox-icon"> <a href="#"><i class="icon-line-circle-check"></i></a> </div> <h3>Endless Possibilities</h3> <p>Complete control on each & every element that provides endless customization possibilities.</p> </div> </div> <div class="clear"></div> <div class="col_one_third bottommargin-sm"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="600"> <div class="fbox-icon"> <a href="#"><i class="icon-bulb"></i></a> </div> <h3>Light & Dark Color Schemes</h3> <p>Change your Website's Primary Scheme instantly by simply adding the dark class to the body.</p> </div> </div> <div class="col_one_third bottommargin-sm"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="800"> <div class="fbox-icon"> <a href="#"><i class="icon-heart2"></i></a> </div> <h3>Boxed & Wide Layouts</h3> <p>Stretch your Website to the Full Width or make it boxed to surprise your visitors.</p> </div> </div> <div class="col_one_third bottommargin-sm col_last"> <div class="feature-box fbox-small fbox-plain" data-animate="fadeIn" data-delay="1000"> <div class="fbox-icon"> <a href="#"><i class="icon-note"></i></a> </div> <h3>Extensive Documentation</h3> <p>We have covered each & everything in our Documentation including Videos & Screenshots.</p> </div> </div> <div class="clear"></div> </div> <div class="section topmargin nobottommargin nobottomborder"> <div class="container clearfix"> <div class="heading-block center nomargin"> <h3>Our Latest Works</h3> </div> </div> </div> <?php echo sp_get_portfolio_section();?> <div class="section notopmargin notopborder"> <div class="container clearfix"> <div class="heading-block center nomargin"> <h3>Latest from the Blog</h3> </div> </div> </div> <div class="container clear-bottommargin clearfix"> <div class="row"> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/1.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Bloomberg smart cities; change-makers economic security</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 13th Jun 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 53</a></li> </ul> <div class="entry-content"> <p>Prevention effect, advocate dialogue rural development lifting people up community civil society. Catalyst, grantees leverage.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/2.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Medicine new approaches communities, outcomes partnership</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 24th Feb 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 17</a></li> </ul> <div class="entry-content"> <p>Cross-agency coordination clean water rural, promising development turmoil inclusive education transformative community.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/3.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Significant altruism planned giving insurmountable challenges liberal</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 30th Dec 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 13</a></li> </ul> <div class="entry-content"> <p>Micro-finance; vaccines peaceful contribution citizens of change generosity. Measures design thinking accelerate progress medical initiative.</p> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="ipost clearfix"> <div class="entry-image"> <a href="#"><img class="image_fade" src="images/magazine/thumb/4.jpg" alt="Image"></a> </div> <div class="entry-title"> <h3><a href="blog-single.html">Compassion conflict resolution, progressive; tackle</a></h3> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> 15th Jan 2014</li> <li><a href="blog-single.html#comments"><i class="icon-comments"></i> 54</a></li> </ul> <div class="entry-content"> <p>Community health workers best practices, effectiveness meaningful work The Elders fairness. Our ambitions local solutions globalization.</p> </div> </div> </div> </div> </div> <div class="section"> <div class="container clearfix"> <div class="heading-block topmargin-sm center"> <h3>Meet Our Team</h3> </div> <div class="row"> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/3.jpg" alt="John Doe"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>John Doe</h4><span>CEO</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/2.jpg" alt="Josh Clark"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Josh Clark</h4><span>Co-Founder</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/8.jpg" alt="Mary Jane"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Mary Jane</h4><span>Sales</span></div> </div> </div> </div> <div class="col-lg-3 col-md-6 bottommargin"> <div class="team"> <div class="team-image"> <img src="images/team/4.jpg" alt="Nix Maxwell"> </div> <div class="team-desc team-desc-bg"> <div class="team-title"><h4>Nix Maxwell</h4><span>Support</span></div> </div> </div> </div> </div> </div> </div> <?php echo sp_get_clients_section();?> </div> </section><!-- #content end --> <?php get_footer(); |