Forum Replies Created

Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter skipcollege

    (@skipcollege)

    Well thank you for the code Nazgul, it helped me out immensely!

    Thread Starter skipcollege

    (@skipcollege)

    Wow, awesome! It works like a charm! Can I PayPal you $10 for your help Nazgul?

    Thanks a ton!! ??

    Thread Starter skipcollege

    (@skipcollege)

    I tried the code out and it is changing the url but not working correctly… It is changing every new page into “domain.com/1.html”. Everyone ends in “1.html”.

    In wp-includes/template-functions-post.php, at line 419 I replaced

    $output .= $indent . ‘[li class=”‘ . $css_class . ‘”][a href=”‘ . get_page_link($page_id) . ‘” title=”‘ . wp_specialchars($title) . ‘”]’ . $title . ‘[/a]’;

    with your code…

    $output .= $indent . ‘[li class=”‘ . $css_class . ‘”][a href=”‘ . rtrim(get_page_link($page_id)>, ‘/’) . ‘.html” title=”‘ . wp_specialchars($title) . ‘”]’ . $title . ‘[/a]’;

    I initially received an error about an unexpected comma “,” on this 419 line so I deleted the comma after “($page_id)>” and the error went away.

    In wp-includes/classes.php, at line 1510 I replaced

    $req_uri = preg_replace(“|^$home_path|”, ”, $req_uri);
    $req_uri = trim($req_uri, ‘/’);

    with your code…

    $req_uri = preg_replace(“|^$home_path|”, ”, $req_uri);
    $req_uri = preg_replace(“|.html$|”, ”, $req_uri);

    Did I implement it correctly by replacing those lines in these two files?

    If this can be altered to work that would be great!

    Thread Starter skipcollege

    (@skipcollege)

    Just tested it again on my WP site and they work separately. When I create a Page titled ‘About’ the url turns out as domain.com/about/ so I go to edit the page and change the slug from ‘about’ to ‘about.html’ and the url turns out as domain.com/abouthtml/. Other posts I’ve read by people have confirmed this too.

    Anyone want to hack it for me? $$$

    Thread Starter skipcollege

    (@skipcollege)

    Thanks for the try HandySolo but I’m referring to WordPress Pages not blog posts. ??

    Thread Starter skipcollege

    (@skipcollege)

    bump! Can this be done? Anyone with php skills want to help me out?

    Thread Starter skipcollege

    (@skipcollege)

    This issue is resolved.

    Thread Starter skipcollege

    (@skipcollege)

    Ah, yes the get_bloginfo is working now! Thank you both Viper007Bond and McShelby.

    Thread Starter skipcollege

    (@skipcollege)

    Thanks for the response McShelby…

    I swapped out the bloginfo with get_settings but it didn’t work.


    <?php if (get_settings('name') == 'Site News')
    { echo (get_settings('name')); }
    else { echo ("Blogs ~ " . get_settings('name')); }; ?>

    The output was…

    Blogs ~

    So it obviously went to the else part of the statement when it shouldn’t have because I was at the Site News blog but the blog name didn’t display. I then just tested to see what get_settings(‘name’) would output on its own.

    echo (get_settings('name'));

    It outputted nothing in the browser. Maybe get_settings(‘name’) doesn’t work in WP 2.0?

    Thread Starter skipcollege

    (@skipcollege)

    bump!

    Thread Starter skipcollege

    (@skipcollege)

    Hmm…it seems like the connection to the first database needs to be killed or the variables taken from it need to be cleared before the second loop starts.

    Thank you for the help so far moshu! I will continue to search for the solution. If anyone else can help at this point then it would make my day!

    Thread Starter skipcollege

    (@skipcollege)

    Thanks for the responses! I definitely want to go the Loop route…

    I’ve made some progress and thought it was going to work but there was a problem. It may be exactly what moshu said about the databases.

    I have my non-wp index.php page with 2 different loops in it. When I browse to it though it displays the last excerpt from only the first loop’s blog and displays it twice. The first loop requires “news/wp-blog-header.php” and the second loop requires “journal/wp-blog-header.php”. I thought that this would retrieve the correct last excerpts from both blogs but it did not. It seems as though the variables or connection to the database or something is not being reset after the first loop is done and the second loop is being forced to use the data from the first loop.

    I’m not sure how to correct this. It seems like the data needs to be reset from the first loop before the second loop starts or the loops need to be initiated in a way that hard-defines their source for data?

    Here is the code from my file…


    <?php
    require_once('news/wp-blog-header.php');
    ?>

    <?php query_posts('posts_per_page=1'); ?>
    <h1 id="header"><a>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>

    <!-- // loop start -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('m-d-y', '<h2>','</h2>'); ?>
    <h3 id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>

    <?php the_excerpt(); ?>

    <?php link_pages('Pages: ', '', 'number') ?>

    <em>Posted by <strong><?php the_author() ?></strong></em>
    Filed under: <?php the_category(',') ?>

    <?php comments_popup_link('0 comments', '1 comment', '% comments') ?>

    <?php comments_template(); ?>

    <!-- // this is just the end of the motor - don't touch that line either :) -->
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    <br><br>

    <?php
    require_once('journal/wp-blog-header.php');
    ?>

    <?php query_posts('posts_per_page=1'); ?>
    <h1 id="header"><a>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>

    <!-- // loop start -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('m-d-y', '<h2>','</h2>'); ?>
    <h3 id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>

    <?php the_excerpt(); ?>

    <?php link_pages('Pages: ', '', 'number') ?>

    <em>Posted by <strong><?php the_author() ?></strong></em>
    Filed under: <?php the_category(',') ?>

    <?php comments_popup_link('0 comments', '1 comment', '% comments') ?>

    <?php comments_template(); ?>

    <!-- // this is just the end of the motor - don't touch that line either :) -->
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    Thanks in advance for any help on this! I feel I am so close!

Viewing 12 replies - 16 through 27 (of 27 total)