Forum Replies Created

Viewing 15 replies - 1 through 15 (of 38 total)
  • Thread Starter stml

    (@stml)

    @thatruth2006 I’m not sure that makes sense… the_content() is in use on all these templates – it certainly has *something* to do with index.php…

    This problem is still occurring – no solution found as yet…

    Thread Starter stml

    (@stml)

    Yes, I’ve tried deactivating all plugins. It’s definitely not a plugin issue.

    I wrote a quick plugin that does this. Copy and paste the following into a file called stml_beheader.php in your plugins folder and activate.

    //////////////////////////////////////////

    <?php
    /*
    Plugin Name: STML Beheader
    Description: Removes unneccesary stuff from wp_head
    Author: James Bridle
    Version: 1.0
    Author URI: https://shorttermmemoryloss.com

    */

    remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );
    ?>

    //////////////////////////////////////////

    You can remove other unwanted stuff as well by adding lines like:

    remove_action(‘wp_head’, ‘wlwmanifest_link’);
    remove_action(‘wp_head’, ‘rsd_link’);

    Hope that works for you.

    I had this problem, and it did appear to be caused by setting a static front page. Setting a specific posts page as well fixed it.

    Thread Starter stml

    (@stml)

    To clarify, this has nothing to do with the theme in use.

    Thread Starter stml

    (@stml)

    wp_footer() is completely legitimate. I was using a custom theme, but always leave wp_footer() in in case it is required at some point.

    While it wasn’t in this case, and I could remove it, the problem is not with wp_footer() but the malicious code that was being inserted by it, and working out where this code is, and how it got there, is the primary concern.

    Forum: Fixing WordPress
    In reply to: I was hacked

    This hack is quite seriously widespread, in that I’m noticing it quite regularly in blog results from Google (as per my tweet someone has posted above), now others have noticed in Yahoo.

    There seems to be little info about it on the web – is it time some more senior Devs looked at this a little more closely?

    Thread Starter stml

    (@stml)

    Still haven’t figured this out.

    This solution does not work for me either: https://www.ads-software.com/support/topic/126593

    Thread Starter stml

    (@stml)

    No, nothing there is called lists. And I’ve tried renaming the directory to lots of other things, in any case.

    Thread Starter stml

    (@stml)

    I put in that ‘massive WP fan’ comment to deflect those replies! I’m aware bugs will creep in – what I’m saying is that I’m surprised that tags were implemented in a way that this could happen. It’s criticism, not an attack.

    Have joined wp-testers as I implement on average a couple of WP installs a month, and do want to give something back…

    Thread Starter stml

    (@stml)

    Good to know, and thanks for the info. I’m not going to edit the core, but this seems like a pretty serious thing to me, and I’m surprised it’s possible to confuse tags and categories this easily… it suggests all the implications of adding tags to WP haven’t been fully thought out.

    (I speak as a massive WP fan…)

    Thread Starter stml

    (@stml)

    Note that I still had to reset $post_ID in order to use it in the sidebar after running query_posts:

    <?php
    /*
    Template Name: News
    */
    ?>
    <?php
    get_header();
    $newsid = $post->ID;
    ?>
    	<h2 class="storytitle">News</h2>
    	<div class="storycontent">
    	<?php query_posts('showposts=10'); global $more; $more = 0; while (have_posts()) : the_post(); ?>
    	<h3><?php the_time('j/m/y'); ?>: <a>" alt="Read this article..."><?php the_title(); ?></a></h3>
    		<?php the_content(__('(Read more...)')); ?>
    	<?php endwhile; ?>
    	</div>
    	<?php $post->ID = $newsid; ?>
    <?php get_footer(); ?>
    Thread Starter stml

    (@stml)

    It wasn’t a variable/scoping problem – the problem was in my sidebar:

    <div id="sidebar">
    <h1><span class="smname">Stephenie Meyer</span>&nbsp;</h1>
    <div id="sidebar_content">
    <?php
    if ( is_page() && comments_open() ) { comments_template(); }
    else { echo ''.get_post_meta($post->ID, sidebar, true).'
    '; }
    ?>
    </div>
    </div>

    Because I wasn’t using a loop, the if query couldn’t understand comments_open() – by adding is_page() as well, I forced it to ignore this on query_posts pages.

    Thread Starter stml

    (@stml)

    OK, have now updated my news.php to this:

    <?php
    /*
    Template Name: News
    */
    ?>
    <?php
    get_header();
    $newsid = $post->ID;
    ?>
    	<h2 class="storytitle">News</h2>
    	<div class="storycontent">
    	<?php query_posts('showposts=10'); global $more; $more = 0; while (have_posts()) : the_post(); ?>
    	<h3><?php the_time('j/m/y'); ?>: <a href="<?php the_permalink(); ?>" alt="Read this article..."><?php the_title(); ?></a></h3>
    		<?php the_content(__('(Read more...)')); ?>
    	<?php endwhile; ?>
    	</div>
    	<?php $post->ID = $newsid; echo $post->ID; ?>
    <?php get_footer(); ?>

    As you can see, I’m currently echoing the post ID at the end to test it – it shows the correct ID.

    I also echo it in the sidebar, to double-check – and it’s still the correct ID.

    However, the get_post_meta($post->ID, sidebar, true) still is not working – nothing happens! If I place it at the bottom of news.php, it prints the correct field content, but refuses to do so in the sidebar – even though it’s being passed the correct ID!

    Thread Starter stml

    (@stml)

    OK – can confirm that this method is passing the ID of the last post displayed by query_posts to the sidebar, not the ID of the originating page.

    Anyone know how I can get around this?

Viewing 15 replies - 1 through 15 (of 38 total)