WordPress.org

Ready to get started?Download WordPress

Forums

[AJAX] dynamic content (3 posts)

  1. Matsib
    Member
    Posted 2 years ago #

    Hello,

    I'm currently struggling with dynamic loading content via ajax. I've search the internet for days now and i was unable to find a solution to implement ajax into wordpress the way i want.

    My goal is "quite simple", have something like this -> http://themeforest.net/item/alliansyresponsive-oneslide-wordpress-theme/full_screen_preview/2611576

    I'd like to load the content of pages via ajax, i don't want to hardcode the content of pages with specific page ID like i do sometimes whith posts (see code below).

    <?php
    			$array_id = array (post ID here);
    			foreach($array_id as $key => $value)
    			{
    				$post_id = get_post($value);
    				$title = $post_id->post_title;
    				$content = $post_id->post_content;
    			?>
    			<div>
    				<h2> <?php echo $title;?></h2>
    				<p> <?php echo $content;?> </p>
    			</div>
    			<?php
    			}
    ?>

    I'd like to keep the possibility to add new pages without editing each time the index.php.
    I'd also like to have a slide down effect and url rewriting so google can indexed it. And if possible, keep the meta title of the page but i'm not sure it's possible with ajax.

    I knew it will be a big challenge because i'm a webdesigner and not a dev or a javascript dev, but now i'm out of ideas so if anyone has hints or better, a solution i would greatly apreciate it.

    thanks

    ps: sorry if my english is bad, i'm french.

  2. SNSD Photo
    Member
    Posted 2 years ago #

    you can find tutorial and sample ajax theme on digwp.com

  3. Matsib
    Member
    Posted 2 years ago #

    Thanks SNSD. I aleady know this site and i found a plugin that does the same thing and in my opion, better.

    http://wordpress.org/extend/plugins/ajaxify-wordpress-site/

    it's SEO friendly, hope this helps someone else :]

    now i must found a way to change the fadeIn into a SlideDown :p

Topic Closed

This topic has been closed to new replies.

About this Topic