Skip to main content
Better formatting
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

I tryam trying to add my custom page template to wordpress. I have created a page-portfolio.php to the folder

\wp-content\themes\yoo_master2_wp\layouts

\wp-content\themes\yoo_master2_wp\layouts

My php file has following content:

<?php
/*
Template Name: My Portfolio
*/
// get warp    
$warp = Warp::getInstance();    

// load main template file    
echo $warp['template']->render('template');

if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <article class="uk-article">

        <?php if (has_post_thumbnail()) : ?>
            <?php
            $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting
            $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting
            ?>
            <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>
        <?php endif; ?>

        <h1 class="uk-article-title"><?php the_title(); ?></h1>

        <?php the_content(''); ?>

        <?php edit_post_link(__('Edit this post.', 'warp'), '<p><i class="uk-icon-pencil"></i> ','</p>'); ?>

    </article>

    <?php endwhile; ?>
<?php endif; ?>

<?php comments_template(); ?>

Here is the tutorialtutorial, how it should work: (last part)

http://www.yootheme.com/themes/documentation/developers/customization.

IAccording to this tutorial I should do the following:

<?php
/*
Template Name: My Portfolio
*/
<?php get_header(); ?>

Put your content here...

<?php get_footer(); ?>

But like this I get only a blank page.

The code above is copied from the page.php in layouts and with the code from this post:

http://www.yootheme.com/support/question/5346this post

But I get following error message:

Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

So, does anyone know the correct way to do in warp7? The documentation did not help

I try to add my custom page template to wordpress. I have created a page-portfolio.php to the folder

\wp-content\themes\yoo_master2_wp\layouts

My php file has following content:

<?php
/*
Template Name: My Portfolio
*/
// get warp    
$warp = Warp::getInstance();    

// load main template file    
echo $warp['template']->render('template');

if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <article class="uk-article">

        <?php if (has_post_thumbnail()) : ?>
            <?php
            $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting
            $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting
            ?>
            <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>
        <?php endif; ?>

        <h1 class="uk-article-title"><?php the_title(); ?></h1>

        <?php the_content(''); ?>

        <?php edit_post_link(__('Edit this post.', 'warp'), '<p><i class="uk-icon-pencil"></i> ','</p>'); ?>

    </article>

    <?php endwhile; ?>
<?php endif; ?>

<?php comments_template(); ?>

Here is the tutorial, how it should work: (last part)

http://www.yootheme.com/themes/documentation/developers/customization

I this tutorial I should do following:

<?php
/*
Template Name: My Portfolio
*/
<?php get_header(); ?>

Put your content here...

<?php get_footer(); ?>

But like this I get only a blank page.

The code above is copied from the page.php in layouts and with the code from this post:

http://www.yootheme.com/support/question/5346

But I get following error message:

Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

So, does anyone know the correct way to do in warp7? The documentation did not help

I am trying to add my custom page template to wordpress. I have created a page-portfolio.php to the folder

\wp-content\themes\yoo_master2_wp\layouts

My php file has following content:

<?php
/*
Template Name: My Portfolio
*/
// get warp    
$warp = Warp::getInstance();    

// load main template file    
echo $warp['template']->render('template');

if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <article class="uk-article">

        <?php if (has_post_thumbnail()) : ?>
            <?php
            $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting
            $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting
            ?>
            <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>
        <?php endif; ?>

        <h1 class="uk-article-title"><?php the_title(); ?></h1>

        <?php the_content(''); ?>

        <?php edit_post_link(__('Edit this post.', 'warp'), '<p><i class="uk-icon-pencil"></i> ','</p>'); ?>

    </article>

    <?php endwhile; ?>
<?php endif; ?>

<?php comments_template(); ?>

Here is the tutorial, how it should work (last part).

According to this tutorial I should do the following:

<?php
/*
Template Name: My Portfolio
*/
<?php get_header(); ?>

Put your content here...

<?php get_footer(); ?>

But like this I get only a blank page.

The code above is copied from the page.php in layouts and with the code from this post

But I get following error message:

Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

So, does anyone know the correct way to do in warp7? The documentation did not help

added 909 characters in body
Source Link
Owl
  • 231
  • 4
  • 15

H!

I try to override the page template withadd my new custom codepage template to wordpress. But all I get ishave created a blank white page if I choose the new template in page attributes-portfolio.php to the folder

\wp-content\themes\yoo_master2_wp\layouts

My php file has following content:

<?php
/*
Template Name: My Portfolio
*/
// get warp    
$warp = Warp::getInstance();    

// load main template file    
echo $warp['template']->render('template');

if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <article class="uk-article">

        <?php if (has_post_thumbnail()) : ?>
            <?php
            $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting
            $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting
            ?>
            <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>
        <?php endif; ?>

        <h1 class="uk-article-title"><?php the_title(); ?></h1>

        <?php the_content(''); ?>

        <?php edit_post_link(__('Edit this post.', 'warp'), '<p><i class="uk-icon-pencil"></i> ','</p>'); ?>

    </article>

    <?php endwhile; ?>
<?php endif; ?>

<?php comments_template(); ?>

Here is the tutorial, how it should work: (last part)

I have created a new php file called page-portfolio.php in

\wp-content\themes\yoo_master2_wp\layouts

folder. The content of the file isthis tutorial I should do following:

But like this I have also tried to copy theget only a blank page.php from warp layouts as it

The code above is, and renamed it to page-portfolio.php. With the file like copied from the original page.php, I get the output of the post on a white page, means the header in layouts and footer is not loaded. Also I tried to with the get_footer and get_header and the original page.php code, but the same. I get only a blank page. from this post:

I also tried to add the include of the warp, it did not help at all.http://www.yootheme.com/support/question/5346

But I have already read the warp documentation, unfortunatedly it isget following error message:

Fatal error: Class 'Warp' not really largefound in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

Eager to learn moreSo, if somebody candoes anyone know the correct way to do in warp7? The documentation did not help would be great!

H!

I try to override the page template with my new custom code. But all I get is a blank white page if I choose the new template in page attributes.

Here is the tutorial, how it should work: (last part)

I have created a new php file called page-portfolio.php in

\wp-content\themes\yoo_master2_wp\layouts

folder. The content of the file is following:

I have also tried to copy the page.php from warp layouts as it is, and renamed it to page-portfolio.php. With the file like the original page.php, I get the output of the post on a white page, means the header and footer is not loaded. Also I tried to with the get_footer and get_header and the original page.php code, but the same. I get only a blank page.

I also tried to add the include of the warp, it did not help at all.

I have already read the warp documentation, unfortunatedly it is not really large.

Eager to learn more, if somebody can help would be great!

I try to add my custom page template to wordpress. I have created a page-portfolio.php to the folder

\wp-content\themes\yoo_master2_wp\layouts

My php file has following content:

<?php
/*
Template Name: My Portfolio
*/
// get warp    
$warp = Warp::getInstance();    

// load main template file    
echo $warp['template']->render('template');

if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <article class="uk-article">

        <?php if (has_post_thumbnail()) : ?>
            <?php
            $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting
            $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting
            ?>
            <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>
        <?php endif; ?>

        <h1 class="uk-article-title"><?php the_title(); ?></h1>

        <?php the_content(''); ?>

        <?php edit_post_link(__('Edit this post.', 'warp'), '<p><i class="uk-icon-pencil"></i> ','</p>'); ?>

    </article>

    <?php endwhile; ?>
<?php endif; ?>

<?php comments_template(); ?>

Here is the tutorial, how it should work: (last part)

I this tutorial I should do following:

But like this I get only a blank page.

The code above is copied from the page.php in layouts and with the code from this post:

http://www.yootheme.com/support/question/5346

But I get following error message:

Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp-content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6

So, does anyone know the correct way to do in warp7? The documentation did not help

Source Link
Owl
  • 231
  • 4
  • 15

Custom page template in warp7 (Yootheme template)

H!

I try to override the page template with my new custom code. But all I get is a blank white page if I choose the new template in page attributes.

Here is the tutorial, how it should work: (last part)

http://www.yootheme.com/themes/documentation/developers/customization

I have created a new php file called page-portfolio.php in

\wp-content\themes\yoo_master2_wp\layouts

folder. The content of the file is following:

<?php
/*
Template Name: My Portfolio
*/
<?php get_header(); ?>

Put your content here...

<?php get_footer(); ?>

I have also tried to copy the page.php from warp layouts as it is, and renamed it to page-portfolio.php. With the file like the original page.php, I get the output of the post on a white page, means the header and footer is not loaded. Also I tried to with the get_footer and get_header and the original page.php code, but the same. I get only a blank page.

I also tried to add the include of the warp, it did not help at all.

I have already read the warp documentation, unfortunatedly it is not really large.

Eager to learn more, if somebody can help would be great!