How do i populate my Screen with a custom post-type and more than one from each site in the network?

This theme is very cool. and just what i am looking for... However, I have a custom post type in one site this is using a custom theme... I am trying out network on my MAIN site.. i would like to publish "events" and other custom post types to my main site home page... how do i do that? Further more. can i set it up to bring more than one from a network blog? and can i make Featured image mandatory for all networked blogs. or skip publishing a post that does not have a featured image. Curious. thanks in advance.

  • Timothy Bowers
    • Chief Pigeon

    Hey there.

    There are numerous ways this theme works depending on those settings. So it would be hard for me to be exact. Open:

    /themes/network/library/functions/custom-functions.php

    You'll find lines like these:

    AND post_type = 'post'

    Make it like this:

    AND post_type = 'incsub_event'
    OR post_type = 'post'

    If you want to pull all post types and loop em through you'd need to custom code that or hire a developer.

    can i set it up to bring more than one from a network blog?

    Not sue what you mean?

    For a featured image there was a plugin working towards this:

    http://wordpress.org/extend/plugins/mandatory-fields/

    Might be worth asking that developer.

    or skip publishing a post that does not have a featured image.

    You would check for the image being included and if not do nothing. You'd have to custom code that up as well. It's not available by default.

    Take care.

  • scot
    • Site Builder, Child of Zeus

    Thanks for this.. i guess i need a pro. hmm... how about this one.

    I have domain mapping for some sites. so they look "stand alone." with this theme if a visitor rolls over the site name and it is mapped.. it shows the subsite name vs. the actual domain name.

    Take a look. http://www.yachtsplus.com/ roll over the words "Pacific Yacht Group." it should show.. pacificyachtgroup.com the link works but the little window that tells observant and picky clients that this is a subdomain.

    i dont think this this is a deal closer but i notice it. also if you click on the first post. on this page with the same theme... i think it is a yellow boat. you will see custom post type working. THANKS DUDE. cause that is sweet.

  • Tom Eagles
    • Syntax Hero

    @scot hey there

    The pyg subdomain isnt a full domain mapped to the network domain? If it isnt then thats the expected results.

    I am not sure of the legal side of trying to mask a subdomain as a full domain (in case the full domain is actually owned by somebody else.)

    it would be like me doing the same thing and masking a subdomain of mine as your sites domain.

    but if its a full domain mapped to a network site then i would go back over your settings. Especially the part about how the domains are mapped.

  • scot
    • Site Builder, Child of Zeus

    Tom i do no know what this means. (in case the full domain is actually owned by somebody else.)

    I own pacificyachtgroup,com
    i created a site network site called pyg.yachtsplus.com which i also own.
    I use your domain mapping tools and point it where it says to point.
    i do not think this theme works correctly with the domain mapping tools as the roll over shows... it is wrong. i can probably live with it but it is not correct.

    Another question. how come the default image for no image is an active link to the post but the featured image of a post is not. is there something special i have to do when adding a featured image?

  • scot
    • Site Builder, Child of Zeus

    The site was going to the subdomain. something changed with this and now it is not. seeme to be working again.

    Custom post types stopped working.

    How do i make the image in a post on the home page from another site also link to the post? if there is not featured image this is done automatically?

    take a look. http://www.yachtpress.com

  • scot
    • Site Builder, Child of Zeus

    I did an update with the domain mapping plugin a few days ago.

    The images do not link to the article unless there is no image and it pulls the default from the theme itself.

    I removed the functions to pull the custom post type because it was pulling drafts. i think it had to do with the permalink structure of my custom post type.. but i am not sure.

    i have noticed it is not responsive though on my ipad. i may skip this whole process and look for another solution.

    frustrating.

  • scot
    • Site Builder, Child of Zeus

    @tom i am not sure what theme layout you are referring too? which one was the "original" ? I like hearing that someone liked the layout.

    As for the plugin everything is working. i am not going to touch it.

    As for the theme it is working as described except for the image linking. and i cannot get custom-post types to work. but the theme does not mention that it should so i guess everything works except for the image linking but that may be the way i upload the image??

  • scot
    • Site Builder, Child of Zeus

    @tom, This same theme though? huh... How do you center three images on this theme? that would be nice. i do not recall it. but thanks for the props. :slight_smile: i have a few sites i am working on... it seems all at once.

  • Timothy Bowers
    • Chief Pigeon

    As for the theme it is working as described except for the image linking. and i cannot get custom-post types to work. but the theme does not mention that it should so i guess everything works except for the image linking but that may be the way i upload the image??

    By default it doesn't support other post types. You'd need to make the edit I describe in one of my initial posts.

    If you need something custom with images linking then you'd need to edit the code for that also.

    Thanks.

  • scot
    • Site Builder, Child of Zeus

    having the image link tot he site is not custom. the default image links to the site if i do not put a featured image in. thus there is an error either in design or the way i am putting the image in. It is intended to be click-able. otherwise the default image that comes with the theme would not be click-able and it clearly is with no coding from me.

    so how do i make my featured image click-able on the home page of this theme? .

    as for the custom post type. i had it working and then is stopped i may do a fresh install and try it again but.. not today. thanks.

  • magichew
    • Design Lord, Child of Thor

    I see what you mean about that scot.

    I have noticed that if you don't set a featured image in a post, the default thumbnail on the network theme page is clickable and takes you to the post. Add your own featured image and the image is not clickable, the only way to view the post is click the title text above the thumbnail or get to the site by clicking the site name below.

  • Timothy Bowers
    • Chief Pigeon

    To make it clickable do this:

    /network/library/functions/custom-functions.php Line 461:

    <img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=false&blogdirid=<?php echo $blog; ?>" alt="" style="width:227px; height: 108px;" />

    To:

    <a href="<?php $thispermalink; ?>"><img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=false&blogdirid=<?php echo $blog; ?>" alt="" style="width:227px; height: 108px;" /></a>

    Line 470:

    <img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=false&blogdirid=<?php echo $blog; ?>" alt="" style="width:227px; height: 108px;" />

    To:

    <a href="<?php $thispermalink; ?>"><img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=false&blogdirid=<?php echo $blog; ?>" alt="" style="width:227px; height: 108px;" /></a>

    And finally line 613:

    <img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=true&blogdirid=<?php echo ( preg_match('/^\/?blogs.dir/', $upload_dir) ) ? $blog : 0; ?>" alt="" style="width:227px; height: 108px;" />

    To:

    <a>"><img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=true&blogdirid=<?php echo ( preg_match('/^\/?blogs.dir/', $upload_dir) ) ? $blog : 0; ?>" alt="" style="width:227px; height: 108px;" /></a>

    That should cover multisite and single site.

    I'll also ping the developer to look at adding this.

    Thanks.

  • Timothy Bowers
    • Chief Pigeon

    Seem that last one in my post was messed up somehow....

    Should be:

    <a href="<?php $thispermalink; ?>"><img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=true&blogdirid=<?php echo ( preg_match('/^\/?blogs.dir/', $upload_dir) ) ? $blog : 0; ?>" alt="" style="width:227px; height: 108px;" /></a>

    Take care.

  • Timothy Bowers
    • Chief Pigeon

    I see what happened there.

    Add in echo before permalink();

    Like on line 617:

    <div class="thumb"><a href="<?php echo $thispermalink; ?>">
    					<img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=true&blogdirid=<?php echo ( preg_match('/^\/?blogs.dir/', $upload_dir) ) ? $blog : 0; ?>" alt="" style="width:227px; height: 108px;" />
    					</a></div>

    Cheers.

  • scot
    • Site Builder, Child of Zeus

    I added a bunch of echos in front of $thispermalink; the code is below.. it seems to work now. If i want them to open into a new window.. can i add something like target_blank? i thought there was a standard option in wordpress to do that. ? any ideas.

    Nice work on helping with these images.

    <?php if ($thumbnail != '') { ?>
    					<a href="<?php echo $thispermalink; ?>"><img src="<?php bloginfo('template_directory'); ?>/library/functions/timthumb.php?src=<?php echo $thumbnail; ?>&h=108&w=227&zc=1&multisite=true&blogdirid=<?php echo ( preg_match('/^\/?blogs.dir/', $upload_dir) ) ? $blog : 0; ?>" alt="" style="width:227px; height: 108px;" /></a>
    					<?php } else if ($default_thumbnail_url != '') { ?>
    						<div class="thumb"><a href="<?php echo $thispermalink; ?>"><img src="<?php echo $default_thumbnail_url; ?>" alt="" /></a></div>
    					<?php } 	else { ?>
    							<div class="thumb"><a href="<?php echo $thispermalink; ?>"><img src="<?php bloginfo('template_directory'); ?>/_inc/images/placeholders/article.jpg" alt="" /></a></div>
    						<?php } ?>
    			<?php }
    
    		?>
    						<h2><a href="<?php echo $thispermalink; ?>"><?php echo limit_words($thispost[0]->post_title, 5); ?></a></h2>
    						<h3><a href="<?php echo $options[0]->option_value; ?>"><?php echo $options[1]->option_value; ?></a></h3>
    				  </li>
    				<?php
  • Timothy Bowers
    • Chief Pigeon

    Sure, just add in the target="_blank"

    So with the anchor like:

    <a href="<?php echo $thispermalink; ?>" target="_blank">

    You may even want a title in there like:

    title="<?php limit_words($thispost[0]->post_title, 5); ?>"

    I use that as an example, that restricts the total amount of words in a title to 5. You might like to remove or change that, you might not as well :slight_smile:

    I reckon the reason that _blank was not added was to keep it a steady flow through your site or network, you know to make it stay in the same tab as a single site.

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.