"Recent Posts" not showing custom post types

Community Forums Forums Design Tips and Tricks "Recent Posts" not showing custom post types

This topic is: not resolved

This topic contains 24 replies, has 3 voices, and was last updated by  styzer 3 months ago.

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #112770

    braddalton
    Participant
    Post count: 9959

    I have written about this many times already but it may be a problem with your existing code modifications.


    #112775

    styzer
    Participant
    Post count: 97

    Can you direct me to your writings?

    #112781

    braddalton
    Participant
    Post count: 9959
    #112782

    styzer
    Participant
    Post count: 97

    OK, I found it.

    here is the code I’m using, and after resaving my permalinks all my former “Newsletters” posts have disappeared. Is there a code to grab all the CPT that were created before today instead of disappearing?

    //* Create Custom Post Type
    add_action( 'init', 'add_custom_post_type' );
    function add_custom_post_type() {
     
    register_post_type( 'newsletters',
    array(
    'labels' => array(
    'name' => __( 'Newsletters', 'ortzion' ),
    'singular_name' => __( 'Member', 'ortzion' ),
    ),
    'has_archive' => true,
    'hierarchical' => true,
    'menu_icon' => 'dashicons-admin-users',
    'public' => true,
    'rewrite' => array( 'slug' => 'newsletters', 'with_front' => false ),
    'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes' ),
    'taxonomies' => array( 'category' ),
    'menu_position' => 2,
     
    ));
    }

    Thanks!

    #112788

    braddalton
    Participant
    Post count: 9959

    I think you should start again as its not working out for you.


    #112790

    styzer
    Participant
    Post count: 97

    I really do appreciate the resources you share online, Brad. However, this is a help/support forum. Maybe it’s a disorder with some people who accumulate a lot of knowledge, but the one-liners you respond are totally unhelpful. It’s almost as if you’re casually mocking me, or something. Please stop responding if you have nothing helpful to share, as it takes the space of others who could otherwise want to be relationally helpful. I’m sure you know what do to, or have a very good idea how to help me in this case, IF ONLY you put a little effort into it.

    Start again? From where? To where? Did you notice something I did wrong? COULD YOU POINT IT OUT?

    I search for days sometimes to find solutions, so I do put in the work. If you have an easy answer for someone, then I wonder what kind of game you’re playing, or, alternatively, you may just be oblivious to the way you come across. But the result is disheartening. Enough to make me look for a different platform.

    So I hope this was helpful and will inspire you to consider the way you interact on a HELP forum. Otherwise, please do not reply to any of my posts anymore, because it’s a waste of time for me if you can’t follow-up and be “engaged” and “accountable” with the directions you’re offering.

    I’m sure many have been helped, and your site shows you do know a lot. I’m just hoping you will realize how frustrating it can be for someone on the receiving end of breadcrumbs.

    Sincerely,

    Andre

    • This reply was modified 3 months ago by  styzer.
    • This reply was modified 3 months ago by  styzer.
    #112806

    braddalton
    Participant
    Post count: 9959

    Brian Gardner told me to keep it short.

    Please read the forum rules http://www.studiopress.com/forums/policies-and-guidelines/

    The easiest way to create a custom post type in my opinion in SP themes is to use the code from the Executive Pro theme.

    I do not know what code you have added because it looks like non SP code which you grabbed from somewhere on the internet, not from a SP theme. This is the reason i believe you are having problems.

    If you are getting errors, i suggest you start again with a new file but please don’t blame the volunteers who are giving you the best advice and support for free.


    #112811

    styzer
    Participant
    Post count: 97

    Fair enough, Brad.

    Rule #2 of the Don’ts:

    2- Post vague threads or replies without being constructive.

    When you reply, acknowledge that you understand the issue presented. Then offer a solution that is relevant. To tell I’ll have to do it again, is not the kind of contribution that is helpful. It is just stating the obvious – I do know it’s not working, that’s why I’m back and asking you SPECIFIC questions. Respond to the new questions as best you can, and that will be constructive. But you didn’t follow-up, you just told me in essence: “It’s not working. Try again.”

    If you read my response to you, I am stating that I did try your solution. I grabbed that last code from your own website, where you directed me. But that there are a few things missing in the instructions. For example, your code contains “wpsite” but you don’t say what to replace it with. That would be very helpful. So if you offer a code, make sure you also include directions to required modifications in order for this code to be compatible. Otherwise I’m stuck having to spend hours trying to find out what I did wrong, which I was already doing before posting my request for help.

    Now this is what I’d consider a constructive reply.

    Thanks again,

    Regards,

    Andre

    • This reply was modified 3 months ago by  styzer.
    • This reply was modified 3 months ago by  styzer.
    #112816

    braddalton
    Participant
    Post count: 9959

    It is very hard to fix localized errors because we do not have access to all the PHP code you have added and or modified.


    #112886

    styzer
    Participant
    Post count: 97

    Good morning Brad,

    I’m just trying to help you help me.

    Andre: Can you direct me to your writings?

    Brad: http://wpsites.net/?s=add+portfolio+page

    I went there and started searching for something that could help. Found this code on your site: “Add Custom Post Type To Any Theme.” OK, I thought, maybe that’s what Brad wanted me to find (you simply gave a link, with no details). instructions: “Simply copy the PHP code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.”

    Simple enough, good. So I do that. “You can easily change the name of your custom post type simply by changing all instances of member and members to whatever you like and then re-save your permalinks.” Excellent, simple enough. But what should I do with all instances of “wpsite?”

    Now to the crucial next question: if I used the wrong code to create my CPTs, but I already populated my site with hundreds of posts, how do I ensure that these are not lost? Because when I made the changes, even after resaving my permalinks, the posts were nowhere to be found. I had to undo what I just did, and reload a back-up of functions.php.

    That’s why I try to be exact in my follow-up questions, as I do understand there are differences between themes and situations, and that customization is par for the course. And that’s why I think you need to treat “follow-up” questions differently than first questions, as people take you seriously and will listen to you, your input and time are valued. Maybe there is something here you could gain from…

    Thanks again for everything, and I’m saying this honestly. It was after 3:00 am and after spending 3 days on this, delaying the completion of this project, I got upset when it appeared you were not really following-up but just answering one-liners that were really not helpful. I’m sorry.

    Hopefully, this will have brought something to your attention that will be of use.

    Regards,

    Andre

Viewing 10 posts - 16 through 25 (of 25 total)

You must be logged in to reply to this topic.