Hi,
Can you post your template so I can test it locally?
Sure, here it is:
<div class="topnews-container more-news col-xs-12 col-sm-6 col-md-3 <?php if ( has_post_thumbnail()) { ?>yes-img"<?php } else { ?>no-img"<?php } ?>>
<?php // Top Story Card ?>
<div class="topstories-card">
<?php // Top News Image & Headline ?>
<div class="topnews-img">
<div class="topnews-cat <?php if ( has_post_thumbnail()) { ?>whitecat"<?php } else { ?>blackcat"<?php } ?>>
<?php $categories = get_the_category(); if ( ! empty( $categories ) ) { echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>'; }; ?>
</div>
<?php if ( has_post_thumbnail()) { ?>
<div class="tn-img"><a href="<?php the_permalink(); ?>" class="entry-img">
<?php the_post_thumbnail( 'LatestNews-XSmall' ); ?>
</a></div>
<?php } ?>
</div>
<?php if ( !has_post_thumbnail()) { ?><div class="topnews-textbox"><div class="topnews-text"><?php } ?>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php if (strlen($post->post_title) > 40) {
echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else {
the_title();
} ?></a></h1>
<div class="topnews-author"><?php the_author(); ?></div><div class="topnews-date"><?php echo get_the_date(); ?></div>
<div class="topnews-excerpt col-md-8">
<?php if ( has_post_thumbnail()) { ?>
<p class="short-excerpt"><?php echo get_excerpt(95); ?></p>
<?php } else { ?>
<p class="long-excerpt"><?php echo get_excerpt(180); ?></p>
<?php } ?>
</div>
<?php if ( !has_post_thumbnail()) { ?></div></div><?php } ?>
<?php // END Top News Image & Headline ?>
<?php // Social Icons ?>
<div class="topnews-social <?php if ( has_post_thumbnail()) { ?>"<?php } else { ?>no-img"<?php } ?>>
<div class="topnews-social-group">
<div class="topnews-social-icons">
<div class="addthis_toolbox addthis_default_style topnews-share" data-url="<?php the_permalink(); ?>"
data-title"<?php the_title(); ?>" > <a class="addthis_button_facebook" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_twitter" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_email" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> </div>
</div>
</div>
</div>
<?php // END Social Icons ?>
</div>
<?php // END Top Story Card ?>
</div>
<script language="javascript" type="text/javascript">
function initAddThis()
{
addthis.init('.addthis_toolbox')
addthis.toolbox('.addthis_toolbox');
};
// After the DOM has loaded...
initAddThis();
</script>
FYI, I’m experiencing the same problem on a staging site. There, I tried deleting the template code, and also tried replacing it with the default code, but neither would let me save the changes.
Thanks for your help!
Just tested on my servers. Works over here.
Can you check your console for errors on save?
Thanks for the tip… Here’s what I get after clicking the Save Template button:
POST http://staging.cudenvertoday.org/wp-admin/admin-ajax.php 400 (Bad Request)
load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5
send @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5
m.extend.ajax @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5
_alm_admin.saveRepeater @ admin.php?page=ajax-load-more-repeaters:429
(anonymous function) @ admin.php?page=ajax-load-more-repeaters:471
m.event.dispatch @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:4
r.handle @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:4
FYI, I checked to make sure the http://staging.cudenvertoday.org/wp-admin/admin-ajax.php file is on the server, and it is.
Seems like its probably an issue with your server.
Can you copy your template to somewhere safe and then to simply if and then save?