Forums

[resolved] Small help with integrating wordpress into a website (17 posts)

  1. thepumpkingdom
    Member
    Posted 10 months ago #

    Hi, I'm new to wordpress and I really don't know what I'm doing above a basic coding level. I've looked for the answer all around in the forums and the various tutorials, and I just can't figure it out. Im using twentyeleven with a child theme for CSS changes. I'm attempting to integrate a blog into a website. and I have two problems:

    1. I can't get the text to wrap properly - I've tried every trick in CSS with my child theme. Tried to edit 'function.php' in the child folder. Nothing I've tried will make the width change.

    2. I can't get older / previous post tags to function right either. I'm trying to use showposts=5 and then have the page transfer to the second page - it doesn't seem to work (I have 6 blog posts online)

    Here is my code in the index.php:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Does anyone know what's going on? I can REALLY use the help - I'm just trying to get this running for a friend who is in need - I don't work commercially. The website is http://www.lagniappewines.com/blog

    Thanks!

  2. vtxyzzy
    Member
    Posted 10 months ago #

    The post text is in a table with a hard-coded width of 580px. You can override that by adding this line to your style.css:

    div.post div.entry table {width: 360px !important; }

    I can't see the Previous/Next Posts link or your code, so I can't tell what is happening there.

  3. thepumpkingdom
    Member
    Posted 9 months ago #

    OH! THANKS SO MUCH! THAT DID IT. i'LL KEEP GOING WITH THE PREVIOUS AND NEXT AND GET BACK TO YOU.

    THANK YOU!!!!

  4. thepumpkingdom
    Member
    Posted 9 months ago #

    Ok, the 'next page' tab is at the bottom of the page now, and it should redirect you to 'Post 1' as i called it, but instead links you back to post 7 again.

    any ideas?

    http://www.lagniappewines.com/blog

  5. vtxyzzy
    Member
    Posted 9 months ago #

    I can't connect to your blog - the connection times out. Will try again later.

  6. vtxyzzy
    Member
    Posted 9 months ago #

    I will need to see the code for the blog. Please put it in a pastebin and post a link to it here.

  7. thepumpkingdom
    Member
    Posted 9 months ago #

    hi vtxyzzy,

    i made a pastebin:

    http://pastebin.com/rVxv001U

    thanks again!

  8. vtxyzzy
    Member
    Posted 9 months ago #

    Your query_posts needs the 'paged' argument like this:

    $paged = (intval(get_query_var('paged'))) ? intval(get_query_var('paged')) :
       ((intval(get_query_var('page'))) ? intval(get_query_var('page')) : 1);
    query_posts("showposts=5&paged=$paged");
  9. thepumpkingdom
    Member
    Posted 9 months ago #

    thanks!

    hmm... I tried that, and it didn't seem to do anything - here's the new pastebin:

    http://pastebin.com/86JhTvJu

  10. vtxyzzy
    Member
    Posted 9 months ago #

    You used single quotes to enclose the query_posts arguments. It must be double quotes as I showed above.

  11. thepumpkingdom
    Member
    Posted 9 months ago #

    hey vtxyzzy,

    i should have mentioned that - i tried it both ways and it didn't work either way. It's the double quotes on the site now, and it's still not working right. any other thoughts? i really appreciate it.

  12. vtxyzzy
    Member
    Posted 9 months ago #

    Time to do a little debugging. Please paste this line after your query_posts so the value of $paged and the SQL can be seen.

    echo "\n<!-- PAGED: $paged  REQUEST: $wp_query->request -->\n";
  13. thepumpkingdom
    Member
    Posted 9 months ago #

    ok, i pasted that in the line after the query_posts and uploaded it.

  14. vtxyzzy
    Member
    Posted 9 months ago #

    The value of $paged is staying at 1. I suspect that the reason is that the paged query argument is not getting set because no WP query has been done at the point of your query.

    Please try changing to this:

    $paged = (intval($_GET['paged'])) ? intval($_GET['paged']) : 1;
    query_posts("showposts=5&paged=$paged");
  15. thepumpkingdom
    Member
    Posted 9 months ago #

    nailed it.

    i can't thank you enough - you've been amazingly helpful. I wish i could be as good as you at pushing code ahead!

    i wish there were more people out there like you. do you do this for a living?

  16. vtxyzzy
    Member
    Posted 9 months ago #

    Nope, just a hobby. Check my site: http://wordpress.mcdspot.com

  17. thepumpkingdom
    Member
    Posted 9 months ago #

    ah! so nice!

    if there's ever a favor i can do for you, please let me know!

Reply

You must log in to post.

About this Topic