Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter trubdor

    (@trubdor)

    I resolved my dilemma in a different manner.
    As I mentioned I was new to wordpress and not sure how to proceed.
    I simply created a dynamic process using a custom php program
    that built each page “on the fly”. I believe all Ecommerce type
    sites work this way. Thus, as the visitor makes a request for a
    specific product, the related product code and information is
    passed back to the same application in a query string and the program then runs a query to retrieve the requested information.

    In a situation where someone might want to display 100’s or 1000’s
    of existing .html files within wordpress, you would either have to load
    them into wordpress. I believe the HTML Import 2 plugin could work if
    you loaded small numbers of them instead of all them at once.

    The other method I considered was to use inline frames. If you place
    your href links within a Iframe, the html will load within the Iframe
    which of course is within wordpress.
    This is different than having a link to one your htm files from within a regular wordpress post. The link would cause the html file to overlay your wordpress window or open in another browser window but outside of wordpress – not what you want.

    The other consideration with using Iframe to display a lot of external html files is that they may not be too SEO friendly.

    Buona Fortuna!

    Thread Starter trubdor

    (@trubdor)

    I found the solution to using a URL such as
    http://www.mysite.com/myphpcode/var1-var2-var3 in a wordpress
    page containing custom php code and custom permalinks such as
    /%postname%/

    The solution is described here:
    http://www.rlmseo.com/blog/passing-get-query-string-parameters-in-wordpress-url/

    If you read this you will see that you need to update two php mpodules.
    You must change functions.php located in the root folder for the specific wordpress theme you are using. The other module to change would be your own custom php code where you want to interpret the URL that has just been pressed. Note: In my situation, myphpcode is a program that keeps getting called with different values in the query string. My program, myphpcode, knows how to interpret these query string values because it created the href links in the first place.

    Thus, in my example, http://www.mysite.com/myphpcode/var1-var2-var3

    myphpcode is a wordpress Page that contains my custom php code and
    var1-var2-var3 is acting as a query string.

    The problem was that wordpress did not recognize this URL.
    By default I believe it tried to interpret myphpcode like
    category in a standard wordpress URL with a Post called my-first-topic.
    For example, http://www.mysite.com/category/my-first-topic
    is a standard structure for many wordpress posts.

    I wanted wordpress to recognize myphpcode as a wordpress page containing php code. This can be accomplished using the add_rewrite_rules function described at http://www.rlmseo.com/blog/passing-get-query-string-parameters-in-wordpress-url/

    Here is the complete code as it relates to the URL I have been describing: http://www.mysite.com/myphpcode/var1-var2-var3

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

    In any event, the code added to functions.php did help define my URL with my program and query string to wordpress. I was then able to get the pagename and query string from $_SERVER[“REQUEST_URI”]

    The wordpress site that is actually using this code can be viewed at

    http://babynamesdiary.com/baby-names-and-meanings/baby-names-A-1/

    In this URL, baby-names-and-meanings is a wordpress page containing my custom php code and baby-names-A-1 is the query string.
    The customer for whom I created this application wanted the URL this way for SEO purposes. Hope this helps. Buona Fortuna!

    This is a wordpress convention called a shortcode.
    It can be inserted directly into html and refers to
    custom php code. Developers of plugins often create these.

    Here’s one reference:
    http://codex.wordpress.org/Shortcode_API

    Thread Starter trubdor

    (@trubdor)

    I resolved this by inserting my own php code in the header.php file
    for the theme I was using. To clarify – the header.php file you want to alter is within the theme’s root folder. In this case the theme is called Finesse and I altered the header.php code as shown:

    //Original line

    <title><?php $theme->meta_title(); ?></title>

    /*Altered line – NOTE: I removed the <title> … </title> and inserted this line. You could comment out the <title> line if you want. build-meta-tags.php is my own code which uses information from the query string at the end of my URL. I used this to create the <title> as well as the description and keywords meta tags. Some of the information to use in the tags came from a MySQL query to a table which the user can alter for the various meta tag information they may want to show.*/

    <?php include_once(‘build-meta-tags.php’) ?>

    Thread Starter trubdor

    (@trubdor)

    Sorry. Did not quite get what you were saying.
    I was thinking there was another function I needed to run.
    Yes, I did create my own addMyMetaTagInfo()
    function. I should have added this to my question.

    Here is the complete code I tried.

    add_action(‘wp_head’,’bn_addMetaTagInfo’);
    //—————————————————–
    function bn_addMetaTagInfo()
    {
    echo ‘<title>My Title</title>’;
    echo ‘<meta name=”description” content=”My Description” />’;
    echo ‘<meta name=”keywords” content=”My Keywords” />’;
    }

    Thanks.

    Thread Starter trubdor

    (@trubdor)

    Thanks for the reply.

    I did not know I needed the addMyMetaTagInfo() function.
    Not sure how to use it though. I don’t see any info on this function either.

    I’m still unclear how a meta tag plugin would help me insert meta tag info dynamically unless it has some functionality that lets me provide the meta information as the user requests a new page. The information to be presented in the meta tag is not available until the user makes a selection that runs a MySQL query. Thus it can only be provided as the php code gets it.

    Thank You for your assistance.

    Thread Starter trubdor

    (@trubdor)

    Thanks for the suggestion.

    Thread Starter trubdor

    (@trubdor)

    Thanks for the reply,

    I don’t think the HTML Import 2 plugin is going to be practical for what I want to accomplish. I tried to upload a 1000 pages. It loaded them into the wp_posts table but there was a side effect. I could not get back into the Pages via the dashboard. I had to re-buld wp_posts with less records. I was then able to get back in. HTML Import 2 is probably OK for less pages.

    As an alternative I know an Iframe tag will display another document within wordpress. This might have possibilities but it looks like I have to figure out how to make it work with wordpress because it looks like it messes up the page – the sidebar disappears in the Twenty Ten theme.

    Another option I have been trying is to use PHP code to create dynamic pages. I just need to figure out how to modify .htaccess to get the correct URL’s.

    Thank You.

Viewing 8 replies - 1 through 8 (of 8 total)