Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Database pulling data produces black diamonds with ? marks

Discussion in 'Misc WordPress Requests' started by Steve Stern, Oct 8, 2017.

  1. Steve Stern

    Guest

    Reply To: Database pulling data produces black diamonds with ? marks, by Steve Stern

    Use WP_Query so stuff is properly cached and sanitized. Things work better when you do them the wp way.

    https://codex.wordpress.org/Class_Reference/WP_Query

    $args = array (
    'p' => 461,
    );
    $q = new WP_Query( $args );

    if ( $q->have_posts() } {
    while ( $q->have_posts() ) {
    $q->the_post();
    echo get_the_title();
    }
    }
    wp_reset_postdata();

    Note: Code is not tested; expect typos!

    Reply To: Database pulling data produces black diamonds with ? marks
     
    #1

Share This Page

Web Hosting