logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$5
Edit Single.php

I have been trying to edit a theme and remove all the unwanted scripts. I am having problems with my single.php template:


<?php get_header(); ?>

<div id="content">
<?php

if (have_posts()) :
while (have_posts()) : the_post();

$html_content = get_the_content_with_formatting();
$html_content = reduce_width_height($html_content, 650);
$tags = array("img", "object", "br");
$portfolio_single = get_post_meta(get_the_ID(), "air_portfolio_single", true);
$air_article_navigation = get_post_meta(get_the_ID(), "air_article_navigation", true);

if ($portfolio_single == "yes")
{
$only_text = strip_single_tags($tags, $html_content);

$images = get_all_img_urls($html_content);
$alts = get_all_img_alts($html_content);


$link_text = get_post_meta(get_the_ID(), "air_link-text", true);
if ($link_text == "") $link_text = "View Online &raquo;";
$link_url = get_post_meta(get_the_ID(), "air_link-url", true);
$air_services = get_post_meta(get_the_ID(), "air_services", true);
$services = explode(",",$air_services);
$video_link = get_post_meta(get_the_ID(), "air_video_link", true);
?>

<?php } else { ?>

<div id="sidebar"><?php dynamic_sidebar( 'default' ); ?></div>

<div id="inner-content">
<div class="post-entry">
<div class="post-meta">

<h2 class="title"><?php the_title(); ?></h2>

<span>by </span><?php the_author_link(); ?> <span>on </span><?php the_time('M j, Y') ?><?php if (comments_open()) { ?><span> - </span><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?><?php } ?>

</div><!--END post-meta-->

<?php the_content(); ?>

</div><!--END post-entry-->

<?php comments_template(); ?>

</div><!--END inner-content-->

<?php } endwhile; else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>

</div><!--END content-->

</div><!--END wrapper-->

<?php get_footer(); ?>



It breaks everytime I try to remove this part:


$html_content = get_the_content_with_formatting();
$html_content = reduce_width_height($html_content, 650);
$tags = array("img", "object", "br");
$portfolio_single = get_post_meta(get_the_ID(), "air_portfolio_single", true);
$air_article_navigation = get_post_meta(get_the_ID(), "air_article_navigation", true);

if ($portfolio_single == "yes")
{
$only_text = strip_single_tags($tags, $html_content);

$images = get_all_img_urls($html_content);
$alts = get_all_img_alts($html_content);


$link_text = get_post_meta(get_the_ID(), "air_link-text", true);
if ($link_text == "") $link_text = "View Online &raquo;";
$link_url = get_post_meta(get_the_ID(), "air_link-url", true);
$air_services = get_post_meta(get_the_ID(), "air_services", true);
$services = explode(",",$air_services);
$video_link = get_post_meta(get_the_ID(), "air_video_link", true);


Please can someone remove this part and tidy up the template so that it doesn't cause any errors?

This question has been answered.

julesphoto | 04/19/11 at 5:14am Edit


(2) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    04/19/11
    5:32am
    AdamGold says:


    <?php get_header(); ?>



    <div id="content">

    <?php



    if (have_posts()) :

    while (have_posts()) : the_post();


    ?>


    <div id="sidebar"><?php dynamic_sidebar( 'default' ); ?></div>



    <div id="inner-content">

    <div class="post-entry">

    <div class="post-meta">



    <h2 class="title"><?php the_title(); ?></h2>



    <span>by </span><?php the_author_link(); ?> <span>on </span><?php the_time('M j, Y') ?><?php if (comments_open()) { ?><span> - </span><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?><?php } ?>



    </div><!--END post-meta-->



    <?php the_content(); ?>



    </div><!--END post-entry-->



    <?php comments_template(); ?>



    </div><!--END inner-content-->



    <?php endwhile; else : ?>

    <h2 class="center">Not Found</h2>

    <p class="center">Sorry, but you are looking for something that isn't here.</p>

    <?php endif; ?>



    </div><!--END content-->



    </div><!--END wrapper-->



    <?php get_footer(); ?>

    Previous versions of this answer: 04/19/11 at 5:28am

  • avatar
    Last edited:
    04/19/11
    5:20am
    Jens Filipsson says:

    <?php get_header(); ?>

    <div id="content">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>


    <div id="sidebar"><?php dynamic_sidebar( 'default' ); ?></div>



    <div id="inner-content">

    <div class="post-entry">

    <div class="post-meta">



    <h2 class="title"><?php the_title(); ?></h2>



    <span>by </span><?php the_author_link(); ?> <span>on </span><?php the_time('M j, Y') ?><?php if (comments_open()) { ?><span> - </span><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?><?php } ?>



    </div><!--END post-meta-->



    <?php the_content(); ?>



    </div><!--END post-entry-->



    <?php comments_template(); ?>



    </div><!--END inner-content-->



    <?php endwhile; else : ?>

    <h2 class="center">Not Found</h2>

    <p class="center">Sorry, but you are looking for something that isn't here.</p>

    <?php endif; ?>



    </div><!--END content-->



    </div><!--END wrapper-->



    <?php get_footer(); ?>

This question has expired.





Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.