Support » Themes and Templates » WordPress pages vs custom pages

  • The custom non-blog webpages can be created either within WordPress or using regular PHP pages.

    Which method is better? popular? or easy to use?

    I guess the custom pages can use WP users/cookies/themes/templates as well, right?

    For MySQL query, is it good to use WP $wpdb class or not?

    Any advice is appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi

    (@esmi)

    Forum Moderator

    I guess the custom pages can use WP users/cookies/themes/templates as well, right?

    Correct.

    For MySQL query, is it good to use WP $wpdb class or not?

    What for?

    Below is the URL of WP $wpdb class.

    http://codex.wordpress.org/Class_Reference/wpdb

    It provides the function to query MySQL tables. e.g. $myrows = $wpdb->get_results( "SELECT id, name FROM mytable" );

    We can also query tables using the native PHP mysql_query() function.

    Which way is better? any pron and cons of each one?

    Thanks.

    BTW, for WordPress pages vs custom pages. Which one is more popular or better to use? Thanks.

    esmi

    (@esmi)

    Forum Moderator

    Which way is better?

    Using wpdb – although, depending upon what table you are querying and what data you are looking for, there may be even better functions to use. Personally, I’ve only ever used wpdb when querying tables that aren’t native to WordPress. Using in-built WP functionality should decrease the likelihood of you having to carry out any remedial work if the WP database structure changes in the future.

    Which one is more popular or better to use?

    Not sure that you mean by “custom pages”? Do you mean pages created outside of WordPress?

    Hi esmi, thanks for reply. You are right, I mean pages/PHP files created outside of WordPress when I say “custom pages”. Do you have any idea?

    I’d like to query my own tables. If I understand you correctly, you mean you use wpdb to query the tables other than WordPress tables, right?

    esmi

    (@esmi)

    Forum Moderator

    Personally, I prefer to create all pages through WordPress. If you use custom page templates, you can query your own tables without any problem via the template’s code.

    Thanks esmi.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress pages vs custom pages’ is closed to new replies.