Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [wordpress]Wpisy na innej stronie
grzes999
post
Post #1





Grupa: Zarejestrowani
Postów: 305
Pomógł: 29
Dołączył: 5.07.2011

Ostrzeżenie: (0%)
-----


Witam

Chcę na inne stronie nie Wordpressowej wstawić wpisy z wordpressa.
Czytanie z rss odpada bo będę musiał pobrać obrazki w tych wpisach. Pobieranie z bazy też wolał bym pominąć.
Znalazłem niby coś w internecie; ale jakoś nie bardzo mi to działa albo nie potrawie tego użyć.

  1. <?php define('WP_USE_THEMES', false); require("adres_wp/wp-blog-header.php"); get_header(); ?>


I powyższa funkcja niby powinna mi uaktywniać wszystkie funkcje wordpressa. Wklejam ją do pliku strony na której chcę umieści wpisy z wordpressa.

To daję w body swojej strony(nie wordpresowej)

  1. <?php if ( have_posts() ) : ?>
  2.  
  3. <?php twentyeleven_content_nav( 'nav-above' ); ?>
  4.  
  5. <?php /* Start the Loop */ ?>
  6. <?php while ( have_posts() ) : the_post(); ?>
  7.  
  8. <?php get_template_part( 'content', get_post_format() ); ?>
  9.  
  10. <?php endwhile; ?>
  11.  
  12. <?php twentyeleven_content_nav( 'nav-below' ); ?>
  13.  
  14. <?php else : ?>
  15.  
  16. <article id="post-0" class="post no-results not-found">
  17. <header class="entry-header">
  18. <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  19. </header><!-- .entry-header -->
  20.  
  21. <div class="entry-content">
  22. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  23. <?php get_search_form(); ?>
  24. </div><!-- .entry-content -->
  25. </article><!-- #post-0 -->
  26.  
  27. <?php endif; ?>


I nic mi nie wyświetla :/
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 11:47