WordPress.org

Forums

Spun
[resolved] Link to second blogsite (44 posts)

  1. ravart
    Member
    Posted 2 years ago #

    hi,
    i am working on a companion blogsite, to my spun-child site. i want the visitor to my spun-child site when clicking one particular circle (named "blog") to be sent to the companion blogsite (a complete different url ) to its homepage. also, clicking on the menu at the top name "blog" would also take visitor to companion site.
    hope this is clear.
    thanks,
    Art

  2. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    clicking on the menu at the top name "blog" would also take visitor to companion site.

    You can set up a menu in the dashboard under Appearance > Menus and then you can specify a custom link http://codex.wordpress.org/Appearance_Menus_Screen

  3. ravart
    Member
    Posted 2 years ago #

    thanks -
    ok
    i have a menu called "blog" already -

    do i have to create code?

    would this also work for clicking on a circle/post? or is this a separate issue

    thanks again,
    Art

  4. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    You don't have to create code to change your menu item's link, you go to the dashboard under Appearance > Menus and there you use the "Links" section: http://snag.gy/A0RqG.jpg

  5. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    would this also work for clicking on a circle/post?

    Nope, separate issue.

  6. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    i want the visitor to my spun-child site when clicking one particular circle (named "blog") to be sent to the companion blogsite

    What I think you'll have to end up doing here is installing this plugin: http://wordpress.org/plugins/custom-content-type-manager/

    Then creating a Custom Field that's present when you edit any of your posts.

    That Custom Field will hold the URL that you want the post to go to.

    Then in the code for the Home page you just need to write an extra bit that checks to see if that Custom Field has been filled out and if it has the code should use that URL. Otherwise it'll default to its post URL.

  7. ravart
    Member
    Posted 2 years ago #

    okay

    1) created link from website 1 to companion site 2 (blog) thanks !!! works yay.

    2) installed above CCTM - now will try to figure what you wrote previously pasted below:

    "Then creating a Custom Field that's present when you edit any of your posts.

    That Custom Field will hold the URL that you want the post to go to.

    Then in the code for the Home page you just need to write an extra bit that checks to see if that Custom Field has been filled out and if it has the code should use that URL. Otherwise it'll default to its post URL."

    Not sure - i know what to do here - "write an extra bit checks.......URL"
    but i will try to see what CCTM is all about.

  8. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Then creating a Custom Field that's present when you edit any of your posts.

    In the Custom Content Types part of the dashboard: http://snag.gy/tCyzd.jpg

    1. Go to the "Custom Fields" tab: http://snag.gy/afDU3.jpg
    2. Press the "Create Custom Field" button: http://snag.gy/7pgdF.jpg (ignore the custom fields in the screenshots I have already)
    3. Select the "Create Text" button: http://snag.gy/NcUAP.jpg
    4. This screenshot, http://snag.gy/ckgaW.jpg , will outline the areas you need to fill in from the following steps:
    5. In "Label" enter "Custom Link"
    6. In "Name" enter "custom_link"
    7. In "Default Value" enter "http://"
    8. Under "Associations" tick the "post" checkbox
    9. Press "Save": http://snag.gy/yiGvm.jpg

    Now you should see your Custom Field that you've just created (not on the Webpage but in the dashboard): http://snag.gy/RlZDD.jpg

    To make that Custom Field appear when you edit a post

    1. Go to the "Custom Content Types" part of the dashboard again
    2. Underneath "post" press the "Standardize Custom Fields" link: http://snag.gy/qgewM.jpg
    3. Now edit a post and you should see your "Custom Link" field you've just created: http://snag.gy/UlO7N.jpg

    You don't have to fill in this "Custom Link" field for every or any post, it's only for the circle that you want to link to something else.

    Note that this does not change the website yet

  9. ravart
    Member
    Posted 2 years ago #

    wow - thanks again

    what do you mean "note that this does not change the website yet" ?

    do i type the link to the other website in the "custom link" ?

    thanks
    Art

  10. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    do i type the link to the other website in the "custom link" ?

    Yes, for the post you want to change the circle's link (each circle represents a post).

    what do you mean "note that this does not change the website yet" ?

    You won't see anything different on your home page for example.
    We've only done these 2 steps that I outlined above:

    Then creating a Custom Field that's present when you edit any of your posts.

    That Custom Field will hold the URL that you want the post to go to.

  11. ravart
    Member
    Posted 2 years ago #

    what next?

  12. ravart
    Member
    Posted 2 years ago #

    i typed in url - but it doesn't go to other website

  13. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Your website shouldn't be any different yet.

  14. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Do you have a "content-home.php" file in your Child Theme?

  15. ravart
    Member
    Posted 2 years ago #

    Not yet :)

  16. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Copy the "content-home.php" file from the Spun theme and paste it into your Child Theme folder.

    Then replace all of that file's code with the code from this PasteBin page: http://pastebin.com/rRzNhXbu

  17. ravart
    Member
    Posted 2 years ago #

    okay copied, deleted, replaced - here goes!

  18. ravart
    Member
    Posted 2 years ago #

    :(

    what did i miss?

    http://spiritualcompanioningforseculartimes.org

    what next?

  19. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Can you copy all of your Child Theme content-home.php code out and put it in a PasteBin page: http://pastebin.com and link us that

  20. ravart
    Member
    Posted 2 years ago #

    the Blog Circle does work !!! it goes to other website

    obviously all the links show up and the circles are out of online

    of 2 rows of 3 which you helped to code for me earlier the other day.

  21. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Could you link the thread(s) that I helped you with earlier the other day?

  22. ravart
    Member
    Posted 2 years ago #

    this is getting over my head :)
    how do i link pastebin.com to you?

  23. ravart
    Member
    Posted 2 years ago #

    <?php
    /**
     * @package Spun
     * @since Spun 1.0
     */
    
    /*
     * Get the post thumbnail; if one does not exist, try to get the first attached image.
     * If no images exist, let's print the post title instead.
     */
    
    global $post;
    $postclass = '';
    $url = '';
    $custom_link = '';
    
    // Get the custom link
    if ( function_exists( 'get_custom_field' ) ) {
        $custom_link = get_custom_field( 'custom_link' );
    } else {
        $custom_link = '';
    }
    
    // Check if the custom link exists
    if ( !empty( $custom_link ) ) {
    
        //Add in "http://" if it isn't there already
        if ( strpos( $custom_link,'http://') === false ){
            $custom_link = 'http://' . $custom_link;
        }
    
        $url = $custom_link;
    
    } else {
        $url = the_permalink();
    }
    
    if ( '' != get_the_post_thumbnail() ) {
    	$thumb = get_the_post_thumbnail( $post->ID, 'post-thumbnail', array( 'title' => esc_attr( get_the_title() ) ) );
    }
    else {
    	$args = array(
    				'post_type' => 'attachment',
    				'numberposts' => 1,
    				'post_status' => null,
    				'post_mime_type' => 'image',
    				'post_parent' => $post->ID,
    			);
    
    	$first_attachment = get_children( $args );
    
    	if ( $first_attachment ) {
    		foreach ( $first_attachment as $attachment ) {
    			$thumb = wp_get_attachment_image( $attachment->ID, 'post-thumbnail', false, array( 'title' => esc_attr( get_the_title() ) ) );
    		}
    	}
    	else {
    		$thumb = '<span class="no-thumbnail">' . get_the_title() . '</span>';
    		$postclass = 'no-thumbnail';
    	}
    
    }
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class( $postclass ); ?>>
    	<a>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo $thumb; ?></a>
    </article><!-- #post-<?php the_ID(); ?> -->

    [Please use the code buttons to post code on these forums]

  24. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Copy all the code from your content-home.php file and paste it into this box: http://snag.gy/hkeSE.jpg

    Then press the "Submit" button

    And then just give us the link at the top of your web browser: http://snag.gy/KFmYL.jpg

  25. ravart
    Member
    Posted 2 years ago #

    from the other day

    @media all and (min-width: 1201px) {
    .blog #main {
    width: 60%;
    margin: 0 auto;
    }
    }

  26. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Please copy all of my code again and replace it over your content-home.php file, our files are not the same: http://www.diffchecker.com/net7numl (my code on the left, yours on the right).

  27. ravart
    Member
    Posted 2 years ago #

    okay i'll try again.

    http://spiritualcompanioningforseculartimes.org

    don't know what i'm doing wrong ?

  28. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    Please try to use PasteBin to share the code of your content-home.php file - I feel the code you pasted in this thread had been corrupted by the forum's parser and I'm testing a false negative.

  29. ravart
    Member
    Posted 2 years ago #

    okay - i created a pastebin account

    how do i send you code?

  30. ravart
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic