Tach zusammen.
Wie es der Titel schon sagt möchte ich gerne meine Blog Artikel mittels Loop anzeigen lassen. Sämtliche probleme wo ich hier schon gepostet habe habe ich gelöst. Nun wen ich in meinem Blog einen Artikel schreibe wird er leider nicht in meinen Shop Angezeigt.
Hier ist das Loop
PHP
<?php
/* -----------------------------------------------------------------------------------------
Wordpress Integration for xtcModified
wp-loop.php
http://www.ecommerce-boosting.de
Copyright: Reneo UG 2011
Released under the GNU General Public License
----------------------------------------------------------------------------------------- */
$module_smarty = new Smarty;
$module_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
require('blog/wp-blog-header.php');
$wpdb->query("SET NAMES latin1");
$my_query = new WP_Query();
// Get all available posts
$my_query->query('*');
// Start the Loop
if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post();
$get_all_categories = get_the_category(', '); // Returns Array!
// If more than one Category found loop through the categories and get category-name and link
$get_the_category = array();
if(count($get_all_categories)>=1) {
foreach($get_all_categories as $single_category_item) {
$get_the_category [] = array ('CATEGORY_NAME' => $single_category_item->cat_name, 'CATEGORY_LINK' => get_category_link($single_category_item->cat_ID));
}
}
// Get the content and preformat it
$content = get_the_content();
$content = apply_filters('the_content', $content); // Preformated Content!
$content = str_replace(']]>', ']]>', $content); // Preformated Content!
$module_content[] = array (
'PERMALINK' => get_permalink(),
'THE_TITLE' => get_the_title(),
'THE_TIME' => get_the_time( 'd.m.Y' ),
'THE_AUTHOR' => get_the_author(),
'THE_AUTHOR_LINK' => get_author_posts_url(get_the_author_meta('ID')),
'THE_CATEGORIES' => $get_the_category,
'THE_CONTENT' => $content,
'THE_COMMENTS' => get_comments_number('0', '1', '%'),
'THE_COMMENTS_LINK' => get_comments_link()
);
endwhile;
endif;
if (sizeof($module_content) >= 1) {
$module_smarty->assign('language', $_SESSION['language']);
$module_smarty->assign('module_content', $module_content);
$module_smarty->assign('WP_FOOTER', wp_footer());
// set cache ID
if (!CacheCheck()) {
$module_smarty->caching = 0;
$module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/wp-loop.html');
} else {
$module_smarty->caching = 1;
$module_smarty->cache_lifetime = CACHE_LIFETIME;
$module_smarty->cache_modified_check = CACHE_CHECK;
$cache_id = $new_products_category_id.$_SESSION['language'].$_SESSION['customers_status']['customers_status_name'].$_SESSION['currency'];
$module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/wp-loop.html', $cache_id);
}
$default_smarty->assign('MODULE_wordpress_news', $module);
}
?>
Alles anzeigen
Sind da noch irgendwelche fehler drinn?
Oder hat jemand sonst ein Tipp wie ich das noch Lösen könnte!
Gruss sandro