• Resolved mattyk

    (@mattyk)


    Hi all

    I’m not sure though whether what I’m doing is good practice though as I kind of mixed a few tutorials and made some bits up myself.

    Basically, I already have a site so I thought I’d avoid going down the template route for now.

    I have one of my pages that goes through the basic loop and pulls in all the post titles.

    The titles are surrounded by a href that links to another one of my pages but with the post id as the last bit of the URL – e.g.
    “/blog/mysinglepage.php?p=3”

    I then use PHP to get the id from the query string and store it as a variable.

    Then the loop uses this to query the posts and only displays the post with the relevant post id.

    Does that sound OK to everyone or is this a bit of a “no no”? It does seem a little slow to load (although it could be the server) and I was a little concerned that people might be able to use the URL to hack into posts.

    Any pointers would be very much appreciated as I’m really new to this.

    If you’d like to see this in action:

    https://www.kellymckain.co.uk/blog/test.php

    Cheers
    Matt

Viewing 6 replies - 1 through 6 (of 6 total)
  • I still don’t understand why you would use that linking structure?

    Everything sounds overly complicated…

    Basically, I already have a site so I thought I’d avoid going down the template route for now.

    That’s always a mistake when using WP – it makes thing unnecessarily difficult and complicated.

    Thread Starter mattyk

    (@mattyk)

    Thanks both for the replies. Could anyone point me in the right direction of a better way of doing this?

    I’ve used that linking structure as to me it seems the most appropriate to me.

    I don’t want to use templates as I already have a site. Maybe I’m misunderstanding templates.

    To me, (and I’m probably wrong) it seems reasonable to pull in a list of the posts into a page I have built already. The next thing to do is to link the posts to another page that shows each post’s contents. The permalink always goes to a page that I haven’t made so I haven’t used it.

    Maybe there is a way that the permalink value can be changed (?). I feel as though I have missed a bit of jigsaw puzzle for this so would really appreciate it if someone could point me in the right direction and explain why this method is complicated and what would be a better linking structure.

    much appreciated

    Maybe I’m misunderstanding templates.
    Most likely… And, probably, missed to understand how WP works, too.

    Thousands of WP users did have a site prior to installing a WP blog – and they just created their own custom theme based on the existing site’s design. Period. No mess with complicated permalinks as you want to do it, just using everything out of the box.

    Thread Starter mattyk

    (@mattyk)

    OK thanks. After digging around some more I came across this article:

    https://www.jestro.com/web-design/convert-xhtml-css-to-wordpress/

    I’ve already got my HTML cut into include files but I could still create a simple theme that called these in. I then go into the settings and change the theme to my new one. I think this is the part I hadn’t understood. By setting up my own theme, and then activating it, I change WordPress to use my theme and therefore all the permalinks go to the page I want it to.

    Think I’m getting there. thanks again.

    Thread Starter mattyk

    (@mattyk)

    Just as a follow up and thanks to the people who helped –

    I followed your advice and everything seems much clearer. My only slight issue is that I have a seperate include file for the site to the one I have for the blog. Not really a problem though – I just need to cut them up a bit further.

    Just a quick question if anyone has the time to answer: When you activate a theme, what happens? Does this change WP files or something in the database?

    Thanks again

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘simple way of using on existing site – is this OK?’ is closed to new replies.