messed up the content.php on my theme trying to remove amazon ads
-
Hi there. I’m not a wp expert but my wife’s former design person ghosted her.
She asked me to try to remove the amazon ads from her blog posts so I found the code in the Theme / content.php and in trying to remove it i seem to have messed up the whole site.
I’ve included the code below. Can anyone give me some advice on this.
<?php /** * Template part for displaying posts * * @link https://codex.wordpress.org/Template_Hierarchy * * @package lovewitch */ $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full'); $featured_img_url_large = get_the_post_thumbnail_url(get_the_ID(),'large'); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( !(is_singular()) ) { echo '<a class="blog-post-image" href="' . get_permalink() . '" style="background-image: url(' . $featured_img_url_large . ');"> </a>'; } ?> <header class="entry-header"> <?php if ( is_singular() ) : echo '<a class="header-arrow-down" href="#entry-content" rel="m_PageScroll2id"><i class="fa fa-angle-double-down" aria-hidden="true"></i></a>'; echo '<a class="header-background-image" href="#entry-content" rel="m_PageScroll2id" style="background-image: url(' . $featured_img_url . ')"> </a>'; the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; if ( 'post' === get_post_type() ) : ?> <div class="entry-meta"> <?php lovewitch_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> </header><!-- .entry-header --> <div class="entry-content" id="entry-content"> <?php if ( is_singular() ) : the_content(); if(is_old_post(730)) { if ( is_user_logged_in() ) { echo '<!-- Status: Logged in ' . '-->'; } else { echo '<div id="amzn-assoc-ad-b51ed754-7389-4405-8d49-5e47eb7295cf"></div>//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=b51ed754-7389-4405-8d49-5e47eb7295cf'; } } wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'lovewitch' ), 'after' => '</div>', ) ); else : the_excerpt(); endif; ?> </div><!-- .entry-content --> <footer class="entry-footer"> <?php lovewitch_entry_footer(); ?> </footer><!-- .entry-footer --> </article><!-- #post-<?php the_ID(); ?> --> <div class="clear"> </div>The blog I need help with is: (visible only to logged in users)
-
there block i was trying to edit was here:
if(is_old_post(730)) { if ( is_user_logged_in() ) { echo ‘<!– Status: Logged in ‘ . ‘–>’; } else { echo ‘<div id=”amzn-assoc-ad-b51ed754-7389-4405-8d49-5e47eb7295cf”></div>//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=b51ed754-7389-4405-8d49-5e47eb7295cf‘; } }
-
Hi there,
Apologies, but we can’t help with your issue directly because we don’t host lovewitch.com on our WordPress.com managed hosting.
To explain, we are a fully managed hosting provider and use a custom server environment that is optimized for WordPress, provides built-in security and performance improvements, as well as in-house support for your site questions. You can learn more about the performance and security benefits of our managed hosting here: https://wordpress.com/hosting/
Because of the way we’ve optimized our service, we also use a customized version of WordPress that is different (under the hood) from what you use at Dreamhost. As a result, we do not have access to your site and are not familiar with the source of your issue.
You definitely have the option to move your site to us so we can provide in-house help, and we offer a migration plugin that will help you move your site to our managed hosting in just a few clicks.
The Move to WordPress.com plugin allows you to start migrating a self-hosted WordPress site to WordPress.com directly from the self-hosted site. Prerequisites The Move to WordPress.com plugin installed on your self-hosted WordPress site. Jetpack version 7.9 or higher activated on the self-hosted site. All incompatible plugins deactivated on the self-hosted site. ✅ ThUnfortunately though, as it stands now, we are not able to help since it is hosted elsewhere. The good news is that help is available here at the open-source WordPress forums: https://wordpress.org/support/forum/how-to-and-troubleshooting
The folks in that forum are more familiar with these kinds of issues and are in the best position to help. Thanks!
-
gotcha..thanks. i think i solved the issue anyway, but I’m interested in what you are saying. We are hosted by Dreamhost and it’s been that way for a long time. This site isn’t currently a high priority, but I would love to know what your hosting would offer that Dreamhost doesn’t. I do have a lot on my plate and having a support team that gets wordpress would be great as the person who designed our site is mia.
-
Glad you asked! :)
When it comes to comparing hosting options for your website, there are several advantages to consider when using WordPress.com with the Business plan:
Ease of use and support: WordPress.com offers a user-friendly interface that makes setting up and managing your website a breeze, even if you don’t have technical expertise. Plus, we provide priority email and live chat support to assist you whenever you need help.
Managed hosting: With the Business plan, WordPress.com takes care of all the hosting infrastructure, security, backups, and updates for you. This allows you to focus on creating great content and running your website smoothly without worrying about the technical aspects.
Design and customization options: WordPress.com offers a wide range of professionally designed themes and customization options. This means you can create a visually appealing and unique website that represents your brand. You can even import the theme you’re already using if you prefer!
Built-in features: WordPress.com includes essential features like built-in SEO tools, social media integration, and mobile responsiveness. These features enhance your website’s functionality and help you reach a wider audience.
eCommerce capabilities: I see you’re currently using Shopify, so you also have the option to migrate your store to use WooCommerce where we can also provide support. Here’s an article that explains how and why you should make the switch: https://woocommerce.com/posts/migrate-from-shopify-to-woocommerce/
Analytics and monetization: WordPress.com provides built-in website analytics, allowing you to track your site’s performance and make informed decisions. Additionally, we offer options for monetizing your website through ads and other means.
All these advantages make WordPress.com with the Business plan an excellent choice for individuals and businesses alike. Whether you’re looking for user-friendly hosting, managed infrastructure, customizable design, built-in features, or eCommerce capabilities, WordPress.com has got you covered.
If you have any other questions, we’re here to help!
- The topic ‘messed up the content.php on my theme trying to remove amazon ads’ is closed to new replies.
