• Hi..

    I’m creating a simple xhtml mobile version of my wordpress site. Is there anyway to pull content dynamically from wordpress into the xhtml pages?

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Not.html pages but you could pull them into .php pages. See Integrating_Wordpress_with_Your_Website.

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    but if it’s a mobile site, can you use php? I thought you had to have xhtml?

    You can use PHP. It can generate XHTML.

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    do you have any examples you can point me to as a starting places so I can begin developing?

    thanks!!

    The page at the link I pointed to above should help. Or you could use something like Carrington Mobile.

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    can you edit the carringon mobile plugin to take off search boxes, etc…? I don’t have blog posts on my site, can i remove that from the template?

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    I have this code to generate the xhtml from php:

    <?php header(“Content-type: application/vnd.wap.xhtml+xml; charset=UTF-8″);?><?xml version=”1.0″ encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “https://www.wapforum.org/DTD/xhtml-mobile10.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml”&gt;
    <head>
    <title>Sometitle</title>
    </head>
    <body>
    <h1>Hello</h1>
    <p><?php echo date(‘h:i A, j-M-y’); ?></p>
    </body>
    </html>

    If I want to display the text content from a page in my wordpress site, is that possible?

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    I’m looking through that link. I see the first part is to grab the header…etc…I actually don’t want the header or any parts on my mobile site, I’d just like the text content from the pages. Do I still need to grab the header, etc…?

    It’s not a page header that you will be grabbing – it’s the call to the file that sets everything up so that you can use the Loop. You have to include one or other of the 2 suggested calls to wp-blog-header.php to get the whole thing to work.

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    ok gotcha, thanks for bearing with me on this ??

    so…..
    I will use:

    <?php
    require(‘/the/path/to/your/wp-blog-header.php’);
    ?>

    at the start of my page….now for the rest of the page for my mobile site, can i use this:

    <?php header(“Content-type: application/vnd.wap.xhtml+xml; charset=UTF-8″);?><?xml version=”1.0″ encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “https://www.wapforum.org/DTD/xhtml-mobile10.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml”&gt;
    <head>
    <title>Sometitle</title>
    </head>
    <body>
    <h1>Hello</h1>
    <p><?php echo date(‘h:i A, j-M-y’); ?></p>
    </body>
    </html>

    Almost there…

    Have a look at the example Loop on Integrating_Wordpress_with_Your_Website. Again, you need to use WP’s Loop to display WP posts.

    Thread Starter iluvwrdpress

    (@iluvwrdpress)

    tryng to follow…this is what I have now….a little hard for me to follow, but how to i specify the page i want the content to be pulled from?

    <?php
    require(‘/the/path/to/your/wp-blog-header.php’);
    ?>
    <?php header(“Content-type: application/vnd.wap.xhtml+xml; charset=UTF-8″);?><?xml version=”1.0″ encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “https://www.wapforum.org/DTD/xhtml-mobile10.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml”&gt;
    <head>
    <title>Sometitle</title>
    </head>
    <body>
    <h1>Hello</h1>
    <p><?php define(‘WP_USE_THEMES’, false); get_header(); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php endwhile; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <?php endif; ?>

    </p>
    </body>
    </html>

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘XHTML mobile website – add wordpress content’ is closed to new replies.