static function pages($p)
 {
     $rett = '';
     if (isset($p->post_parent) && $p->post_parent > 0) {
         $parent = get_post($p->post_parent);
         $rett .= self::pages($parent);
     }
     if (!is_page($p->ID)) {
         $rett .= '<li>';
         $rett .= '<a href="' . get_permalink($p->ID) . '" title="' . mythemes_post::title($p->ID, true) . '">' . mythemes_post::title($p->ID, true) . '</a>';
         $rett .= '</li>';
     }
     return $rett;
 }
Exemple #2
0
        the_title();
        ?>
</h1>
                          
                                <!-- TOP META : AUTHOR / TIME / COMMENTS -->
                                <?php 
        get_template_part('templates/meta/top');
        ?>

                                <?php 
        $p_thumbnail = get_post(get_post_thumbnail_id($post->ID));
        if (has_post_thumbnail($post->ID) && isset($p_thumbnail->ID)) {
            ?>
                                        <div class="post-thumbnail overflow-wrapper">
                                        <?php 
            echo get_the_post_thumbnail($post->ID, 'mythemes-classic', array('alt' => mythemes_post::title($post->ID, true)));
            $c_thumbnail = isset($p_thumbnail->post_excerpt) ? esc_html($p_thumbnail->post_excerpt) : null;
            if (!empty($c_thumbnail)) {
                echo '<div class="valign-bottom-cell-wrapper">';
                echo '<footer class="valign-cell">' . $c_thumbnail . '</footer>';
                echo '</div>';
            }
            ?>
                                        </div>
                                <?php 
        }
        ?>

                                <!-- CONTENT -->
                                <?php 
        the_content();
    ?>
            </div>
    <?php 
}
?>

    <h2 class="post-title">
        <?php 
if (!empty($post->post_title)) {
    ?>

            <a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    echo mythemes_post::title($post->ID, true);
    ?>
"><?php 
    the_title();
    ?>
</a>

        <?php 
} else {
    ?>
    
            <a href="<?php 
    the_permalink();
    ?>
"><?php 
    _e('Read more about ..', 'materialize');
 static function shortcode($rett, $_attr)
 {
     global $post;
     $attr = shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'ids' => '', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'mythemes_style' => 'none'), $_attr);
     /* NO MYTHEM.ES SHORTCODE EMBED */
     if (isset($attr['mythemes_style']) && $attr['mythemes_style'] == 'none') {
         return $rett;
     }
     $cols = $attr['columns'];
     $ids = array();
     if (empty($attr['ids'])) {
         $id = intval($attr['id']);
         $orderby = $attr['order'];
         $order = $attr['order'];
         $includes = $attr['include'];
         $exclude = $attr['exclude'];
         if ('RAND' == $attr['order']) {
             $orderby = 'none';
         }
         if (!empty($includes)) {
             $attachments = get_posts(array('include' => $includes, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         } elseif (!empty($exclude)) {
             $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         } else {
             $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         }
         foreach ($attachments as $key => $val) {
             $ids[] = $val->ID;
         }
     } else {
         $ids = explode(',', $attr['ids']);
     }
     $rett = '<div class="mythemes-gallery colls-' . $cols . '">';
     foreach ($ids as $id) {
         $p = get_post($id);
         if (!isset($p->ID)) {
             continue;
         }
         $media = wp_get_attachment_image_src($id, 'large');
         $full = wp_get_attachment_image_src($id, 'full');
         $rett .= '<figure class="mythemes-item ' . $attr['mythemes_style'] . '">';
         $rett .= '<div>';
         $rett .= '<div class="mythemes-thumbnail">';
         $rett .= '<img src="' . $media[0] . '" alt="' . mythemes_post::title($p->ID, true) . '"/>';
         $rett .= '<figcaption>';
         $rett .= '<div class="mythemes-text">';
         if (!empty($p->post_title)) {
             $rett .= '<div class="mythemes-title">';
             $rett .= '<h2>' . mythemes_post::title($p->ID) . '</h2>';
             $rett .= '</div>';
         }
         $excerpt = strip_tags($p->post_excerpt);
         if (!empty($excerpt)) {
             $rett .= '<div class="mythemes-caption">';
             $rett .= '<p>' . esc_html(strip_tags($p->post_excerpt)) . '</p>';
             $rett .= '</div>';
         }
         $rett .= '</div>';
         $rett .= '<a href="' . $full[0] . '" data-gal="prettyPhoto[pp_gal]" title="' . $excerpt . '" class="waves-effect waves-dark"></a>';
         $rett .= '</figcaption>';
         $rett .= '</div>';
         $rett .= '</div>';
         $rett .= '</figure>';
     }
     $rett .= '<div class="clearfix clear"></div>';
     $rett .= '</div>';
     return $rett;
 }
Exemple #5
0
function mythemes_get_menu_childrens($id)
{
    global $mythemes_curr_ancestor;
    $pages = get_posts(array('post_type' => 'page', 'order' => 'ASC', 'post_parent' => $id));
    $rett = '';
    if (!empty($pages)) {
        $rett = '<ul class="sub-menu">';
        foreach ($pages as $p => $item) {
            $classes = '';
            if (is_page($item->ID)) {
                $classes = 'current-menu-item';
                $mythemes_curr_ancestor = true;
            }
            $submenu = mythemes_get_menu_childrens($item->ID);
            if (!empty($submenu)) {
                $classes .= 'menu-item-has-children';
                if ($mythemes_curr_ancestor) {
                    $classes .= ' current-menu-ancestor';
                }
            }
            $rett .= '<li class="menu-item ' . esc_attr($classes) . '">';
            $rett .= '<a href="' . esc_url(get_permalink($item->ID)) . '" title="' . mythemes_post::title($item->ID, true) . '">' . mythemes_post::title($item->ID) . '</a>';
            $rett .= $submenu;
            $rett .= '</li>';
        }
        $rett .= '</ul>';
    }
    return $rett;
}
Exemple #6
0
            $mythemes_curr_ancestor = false;
            if ($item->post_parent > 0) {
                continue;
            }
            if (is_page($item->ID)) {
                $classes = 'current-menu-item';
            }
            $submenu = mythemes_get_menu_childrens($item->ID);
            if (!empty($submenu)) {
                $classes .= 'menu-item-has-children';
                if ($mythemes_curr_ancestor) {
                    $classes .= ' current-menu-ancestor';
                }
            }
            echo '<li class="menu-item ' . esc_attr($classes) . '">';
            echo '<a href="' . esc_url(get_permalink($item->ID)) . '" title="' . mythemes_post::title($item->ID, true) . '">' . mythemes_post::title($item->ID) . '</a>';
            echo $submenu;
            echo '</li>';
        }
        echo '</ul>';
        echo '</div>';
    }
}
?>
                            </nav>

                        </div>

                    </div>

                </div>
Exemple #7
0
                    <?php 
    $wp_query = new WP_Query(array('p' => get_option('page_on_front'), 'post_type' => 'page'));
    $not_found = true;
    if (count($wp_query->posts)) {
        $classes = implode(' ', get_post_class('mythemes-page', absint(get_option('page_on_front'))));
        /* CONTENT WRAPPER */
        echo '<div class="' . $classes . '">';
        foreach ($wp_query->posts as $post) {
            $wp_query->the_post();
            $p_thumbnail = get_post(get_post_thumbnail_id());
            if (has_post_thumbnail() && isset($p_thumbnail->ID)) {
                ?>
	                                    <div class="post-thumbnail">
	                                    <?php 
                echo get_the_post_thumbnail($post->ID, 'full', array('alt' => mythemes_post::title($post->ID, true)));
                $c_thumbnail = !empty($p_thumbnail->post_excerpt) ? esc_html($p_thumbnail->post_excerpt) : null;
                if (!empty($c_thumbnail)) {
                    ?>
		                                            <footer class="wp-caption">
		                                                <?php 
                    echo $c_thumbnail;
                    ?>
		                                            </footer>
	                                    		<?php 
                }
                ?>
	                                    </div>
                                	<?php 
            }
            /* CONTENT */