0
votes

I use a plugin called "Custom Content Type Manage" this allows me to create a new content type which essentially mimics posts (all done in the name of 'user friendly') This aside, I wrote the following:

<h2><?php single_cat_title( '', true ); ?></h2>
<p>
    <?php 
        $page_id = '5536';
        $page_data = get_page($page_id); 
        print apply_filters('the_content', $page_data->post_content);
    ?>
</p>
<p>
    <?php 
        $category = get_the_category(); 
        $category_id = $category[0]->cat_ID;
        print category_description( $category_id );
    ?>
</p>

<div class="category-list">
    <?php wp_nav_menu(); ?>
</div>

<ul class="leaders-container">
<?php if (have_posts()) : while (have_posts()) : the_post();?>
    <li class="leader-container">
        <?php
            $image = get_custom_field('leader_image:to_image_array');
            $url = get_custom_field('website_url:raw');
            print "<img class='leader-image' src='".$image['0']."'>";
        ?>

        <h2>
            <?php the_title(); ?>
        </h2>
        <?php
            print "</h2>";
            the_content();
            if($url != "#") {
                print "<a class='website-button' href='".$url."' target='_blank'>Visit Website</a>";
            }
        ?>
    </li>

<?php endwhile; endif;?>

What this was doing, was getting the info from the category, and listing all the posts assigned to the category.

In this case, a post was labeled as a "Leader" and a category was their "congregation", so it was listing all the leaders assigned to the congregations.

This is an example of what it should look like http://www.ubmsonline.org/?leader=rabbi-binyamin-sheldrake

However, this only works as it is a direct link from the posts in question

The category on the otherhand, which was working, and did list as many leaders assigned to the category, has now stopped working. http://www.ubmsonline.org/category/ubms-leaders/

As you can see though, its pulling everything across correctly, category description, category title etc, but its just now not showing the posts.

1
What update was it? A plugin update or wordpress itself was updated? Did you manually do it? Usually if plugins are causing problems. You can check by disabling them one by one and see if your posts are working after the conflicting plugin stops. But it is a wordpress upgrade causing this issue than i would suggest reverting back to old version from your back up. It is painful to upgrade wordpress as it often breaks the custom code. - User56756
Well annoyingly, im not the person that does the updating =/ so... i kinda found out that its been updated to the latest version of WP, and no backup was done, though i could get them to contact their web hosts i guess and see if they have any complete server backups from... well when ever it was done, but they just happened to be looking at this page and noticed it no longer worked, so no idea when it broke, it could have been 2, maybe 3 updates ago for all i know? =/ I'll try disabling plugins, might be conflicts from another plugin update... (i hate plugins, dont know why i used them!) - Andrew Gordon
update: All plugins disabled, (apart from the obvious one that i need to make it work) - No change... - Andrew Gordon
You're closing the '<h2>' tag twice: print "</h2>"; - Jesse Kernaghan
Well other thing would be to try and see if page id is correct, $page_id = '5536'; $page_data = get_page($page_id); . Maybe something changed it on update. Since it is not getting any data based on that id at all. Even the image is not coming up. - User56756

1 Answers

1
votes

fixed!

It was to do with a setting that changed on the "Custom Content Type Manager" plugin im using. After alot of research, i stumbled upon the exact problem on the "issues" section of the plugin's FAQ's page.

https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=594

Hopefully this might help others.

In wp-content/plugins/custom-content-type-manager/loader.php the filter mentioned below might be commented, so if you uncomment this add_filter this bug will fix.

// Enable archives for custom post types
    add_filter('request', 'CCTM::request_filter');

Thanks again for every one's help.

Andrew