Adding Custom Post Type

Hi Guys, we want to register a custom post type called 'career', are there are specific requirements we need to be aware of, also can we use the themes default blog page (index.php) and amend it so that it displays all custom post types for the newly registered 'career'.

Thanks
Matt

Comments

  • Is is possible to use the index.php file (the default blog view page, and recode it to list post type 'career' with it's own 'content-post.php' page?
  • Hi,

    have you read this https://codex.wordpress.org/Post_Types? Because everything about custom post types has been explained there and this is how our post types were also made.

    Thanks!
  • Hi Thanks guys, are there any specific files we need to amend, apart from the functions.php file in our child theme? We want to use the same layout as the blog page (index.php) so can we amend the blog file to show the new custom post type or do we also need to amend anyother files in the theme folder to register the new post type? We've checked the wordpress codex, but need to know if there is any specific BeTheme changes we need to make...
  • We don't think so. This should work exactly as it was explained in topic above.
  • Sorry to be a nuisance, but where do I define the new post type so that the new template selects on the new post type?

    Also, the current template for blog uses includes/content-post.php to display the content of the feed, can I define a new script called 'content-career.php', and if so, how do I define this new page in the new post template I'm going to create.

    Thanks
  • edited April 2015
    Sorry but we cant learn or modify files for you because those kind of modifications are not included into theme. Maybe will be easier if you can have a look into template-portfolio.php and meta-portfolio.php files because both are responsible for custom post types. But if this won't be enough for you, then you should contact with your website developer because we do not have other recommendations in this case.

    Thanks for understanding!
  • edited April 2015
    Hi Guys, we've managed to register the post type, and create the page template, but unless we use the following, the page doesn't work:-

    echo '<ul class="posts_group lm_wrapper isotope '. $career_classes .'">';
    echo mfn_content_post( $career_query );
    echo '</ul>';

    I assume we need to define another function called mfn_content_career in order for the template to work properly using it's own single post template. Where is the function for mfn_content_post and mfn_content_portfolio defined within the theme files?

    We tried the following but it gave us a syntax error:-

    echo '<ul class="posts_group lm_wrapper isotope '. $career_classes .'">';
    echo mfn_content_post( $career_query );
    echo '</ul>';

    Thanks
  • Plus we've also created the file 'content-career.php' and uploaded this to the child theme folder with the following amendments made to the code...

    <?php
    /**
     * The template for displaying content in the template-career.php template
     *
     * @package Betheme
     * @author Muffin group
     */

    if( ! function_exists('mfn_content_career') ){
    function mfn_content_career( $query = false, $style = false )

    I guess this is where the function is being defined, and if so, is this file in the correct location and does it need to be defined anywhere else? Are there any specific settings we need to add in order for the template-career.php file to use the content-career.php post file?
  • Those functions are under includes/content-post.php and includes/content-portfolio.php files.
  • Thanks, we found them and have already created the includes/content-career.php file, does this need to be uploaded to the main theme includes folder, or can it be located in the child theme folder?
  • As we know, in main theme folder but you can try in child theme as well. But you must test it and try yourself because we do not offer those kind of solutions as we mentioned previously and also we can't be responsible for any changes made on your side later. Only website developer is responsible for all changes.
  • Ok, thanks anyway guys. We'll try and figure it out and report back with our findings in case they are helpful to anyone else.

  • mkdesignmedia did u manage to complete this task?
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.