Tinkering with Flat theme

Use custom field in portfolio

1. Add following to functions.php

add_action('init', 'schoolie_init');
function schoolie_init() {
add_post_type_support( 'zee_portfolio', 'custom-fields' );
}

2. Add a custom field demo_url to the portfolio posts

3. Locate \wp-content\themes\flat-theme\lib\shotcodes.php

Locate following lines:

<a class="preview btn btn-danger" href="<?php echo $img_src; ?>" rel="prettyPhoto"><i class="icon-eye-open"></i></a>

and

<a class="preview btn btn-danger" title="<?php echo $value->post_title; ?>" href="<?php echo $img_src; ?>" rel="prettyPhoto"><i class="icon-eye-open"></i></a>

Replace the above lines with:

<a class="preview btn btn-danger" href="<?php echo get_post_meta( $value->ID, 'demo_url', true ); ?> " target="_blank"><i class="icon-eye-open"></i></a>

 

Fix the Breadcrumbs to work properly

Inside file \themes\flat-theme\lib\breadcrumbs.php

Change

<li>
    <a href="<?php home_url(); ?>" class="breadcrumb_home"><?php esc_html_e('Home',ZEETEXTDOMAIN) ?></a>
  </li>

by

<li>
    <a href="<?php echo home_url(); ?>" class="breadcrumb_home"><?php esc_html_e('Home',ZEETEXTDOMAIN) ?></a>
</li>

4 thoughts on “Tinkering with Flat theme

  1. Hyun Ki Hua Post author

    Hello @Vajra.

    Just checked your site, and breadcrumbs seem to be working fine. (Clicking on “Home” on the breadcrumb redirects to the home page. This wasn’t working originally.)

    Isn’t that what you are trying to achieve?

    Like

    Reply
  2. Hyun Ki Hua Post author

    Hi Bruno: I am not aware about the comments problem with Flat theme, unfortunately. So yeah I don’t have a fix for it.

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.