• Resolved cgreer96

    (@cgreer96)


    I have added code to the homepage of my current website so that it goes and grabs my posts on my WordPress blog and then displays them on my site. The problem is that I don’t really have much control over how that text appears. I would like to italicize the date and bold the title of each post, then keep the text in the post formatted as it currently appears on my site.

    You can see my site here:
    http://www.drchrisgreer.com/

    and it is grabbing my WordPress posts from here:
    http://www.drchrisgreer.com/siteblog/

    Any tips??

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter cgreer96

    (@cgreer96)

    BTW, here is the current code I am using to grab the posts from WordPress. This is an .html file so I just modified my .htaccess file so that the PHP code could work. Do I add the formatting to this code?

    <?php
    $posts = get_posts('numberposts=10&order=DSC&orderby=post_title');
    foreach ($posts as $post) : start_wp(); ?>
    <?php the_date(); echo "<br />"; ?>
    <?php the_title(); ?>
    <?php the_excerpt(); ?>
    <?php
    endforeach;
    ?>
    Thread Starter cgreer96

    (@cgreer96)

    Ok, I have figured out the formatting, but the embedded hyperlinks in my WordPress posts are not working. Basically all that appears on my personal website is text with no links.

    This may seem like a silly question, but why aren’t you using the RSS feed to get the data?

    try to use this. may be it will work

    <?php
    $posts = get_posts('numberposts=10&order=DSC&orderby=post_title');
    foreach ($posts as $post) : start_wp(); ?>
    <?php the_date(); echo "<br />"; ?>
    <a href ="<?php get_permalink(); ?>"><?php the_title(); ?></a>
    <?php the_excerpt(); ?>
    <?php
    endforeach;
    ?>
    Thread Starter cgreer96

    (@cgreer96)

    Thanks uwiuw, but that didn’t work. All it did was make the titles of my posts links, but not the actual embedded links.

    Not using RSS because it seems like I have more control over the content using PHP, although maybe the RSS would give me everything I need?

    Still looking for advice…seems like it should be a pretty easy solution but I am a noob with this PHP stuff.

    but the embedded hyperlinks in my WordPress posts are not working.

    Where do you put the embedded hyperlinks… in the content mingle with the rest or you separate them into custom field ?

    Thread Starter cgreer96

    (@cgreer96)

    When I am on the WordPress “new post” area I just type up a new post, highlight the words I want to be linked, click the “link” button, enter in the URL, and it embeds the link in my post. You can see on my actual WordPress blog (linked above) that it works perfectly, but for some reason that link is stripped out when it is brought over to my personal website.

    ups, matbe you have to change <?php the_excerpt(); ?> with <?php the_content(); ?>

    the <?php the_content(); ?> will show those url just like the original post.

    Thread Starter cgreer96

    (@cgreer96)

    Alas, it works! Thanks so much, I appreciate the time you spent helping me!!!

    you’re welcome 😉

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Formatting posts that appear on my personal website’ is closed to new replies.