Clean subpage

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Clean subpage

Post by Colin » 30 Oct 2016, 06:29

Hi home again now please find the child theme zip file attached.
suffu-scion.zip
(2.02 KiB) Downloaded 226 times

lensv
Posts: 252
Joined: 28 Feb 2011, 04:02

Re: Clean subpage

Post by lensv » 14 Nov 2016, 07:21

Thank you for the file!

This took some time, but now I have finally installed the child theme and connected it to Suffusion (and most things looks just the same :))
My question now is, how do I create a new template? What I want is an empty one with no elements what so ever. Just a blank page with a white background...

Best,

/LS

Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Clean subpage

Post by Colin » 14 Nov 2016, 12:46

That is exactly what is supposed to happen with the child theme, nothing changes until you add new files.

Get page.php from Suffusion, edit it to remove the items that you don't want and give it a new name and save it to the suffu-cion folder and assign it to a page.

lensv
Posts: 252
Joined: 28 Feb 2011, 04:02

Re: Clean subpage

Post by lensv » 14 Nov 2016, 13:41

Colin wrote:That is exactly what is supposed to happen with the child theme, nothing changes until you add new files.
That's almost true (my page background changed colour for some reason, but otherwise it looks OK ;))
Get page.php from Suffusion, edit it to remove the items that you don't want and give it a new name and save it to the suffu-cion folder and assign it to a page.
Do you know where I can find a good guide or some help with the syntax for these template pages?

Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Clean subpage

Post by Colin » 14 Nov 2016, 14:08

No sorry I don't. The code is commented so it is fairly easy to understand.

lensv
Posts: 252
Joined: 28 Feb 2011, 04:02

Re: Clean subpage

Post by lensv » 09 Jan 2017, 06:55

I haven't been very successful with the new templates under suffu-scion. When I link a page to any of them they are just void, no content is showing up. :(

I've also made a test and copied the template Magazine from Suffusion and renamed it to magazine1. That didn't work either. Most strange though is that after this I can no longer use the original Magazine template either. Now it shows the same behaviour as the new ones. What may be wrong?

Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Clean subpage

Post by Colin » 09 Jan 2017, 10:02

Post the code for your magazine template here in code tags so I can take a look BUT you do realise that you need to change the form name in the comments in the first few lines don't you?

lensv
Posts: 252
Joined: 28 Feb 2011, 04:02

Re: Clean subpage

Post by lensv » 10 Jan 2017, 01:04

Hi!

As I mentioned not even the original Magazine template is working anymore. I have removed the copy, but I send you the code for the existing template (which I believe should be unmodified).

I also post the address to a test page which is using this specific template http://unikumit.se/test/. As you can see there is nothing visible in the contents area. Actually, the page don't even seem to have a content tag :?:

Code: Select all

<?php
/**
 * Template Name: Magazine
 *
 * Creates a page with a magazine-style layout. If you have a magazine-themed
 * blog you should can use this to define your front page.
 *
 * @package Suffusion
 * @subpackage Templates
 */

get_header();

global $post, $suf_mag_content_enabled, $suf_mag_entity_order, $suf_mag_headlines_enabled, $suf_mag_excerpts_enabled, $suf_mag_categories_enabled;
?>

<div id="main-col">
<?php suffusion_before_begin_content(); ?>
	<div id="content" class="hfeed">
	<?php
	suffusion_after_begin_content();
	if (have_posts()) {
		while (have_posts()) {
			the_post();
			if ($suf_mag_content_enabled == "show") {
				do_action('suffusion_before_post', $post->ID, 'blog', 1);
				?>

		<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php suffusion_after_begin_post(); ?>
			<div class="entry-container fix">
				<div class="entry fix">
					<?php suffusion_content(); ?>
				</div><!--entry -->
			</div><!-- .entry-container -->
			<?php suffusion_before_end_post(); ?>
		</article><!--post -->
			<?php
				do_action('suffusion_after_post', $post->ID, 'blog', 1);
			}
		}
		suffusion_before_end_content();
	}

if (is_array($suf_mag_entity_order)) {
	$sequence = array();
	foreach ($suf_mag_entity_order as $key => $value) {
		$sequence[] = $value['key'];
	}
}
else {
	$sequence = explode(',', $suf_mag_entity_order);
}

foreach ($sequence as $entity) {
	if ($suf_mag_headlines_enabled == 'show' && $entity == 'headlines') {
		global $suf_mag_headline_title;
		if (trim($suf_mag_headline_title)) {
		?>
			<h2 class='suf-mag-headlines-title fix'><?php echo stripslashes($suf_mag_headline_title); ?></h2>
		<?php
		}
		?>
		<section class='suf-mag-headlines fix'>
			<div class='suf-mag-headline-block'>
		<?php
			$headlines = suffusion_get_headlines();
			$headline_ctr = 0;
			if (count($headlines) > 0) {
		?>
				<ul class='mag-headlines'>
		<?php
				$headline_ctr = 0;
				foreach ($headlines as $post) {
					$headline_ctr++;
					if ($headline_ctr == 1) {
						$first_class = 'suf-mag-headline-first';
					}
					else {
						$first_class = '';
					}
		?>
					<li class='suf-mag-headline-<?php echo $post->ID?> suf-mag-headline <?php echo $first_class; ?>'>
						<a href="<?php echo get_permalink($post->ID); ?>" class='suf-mag-headline-<?php echo $post->ID?> suf-mag-headline'><?php echo get_the_title($post->ID); ?></a>
					</li>
		<?php
				}
		?>
				</ul>
		<?php
			}
		?>
			</div>
			<div class='suf-mag-headline-photo-box'>
		<?php
			$headline_ctr = 0;
			foreach ($headlines as $post) {
				$headline_ctr++;
				if ($headline_ctr == 1) {
					$first_class = 'suf-mag-headline-photo-first';
				}
				else {
					$first_class = '';
				}
		?>
				<div class='suf-mag-headline-photo-<?php echo $post->ID?> suf-mag-headline-photo <?php echo $first_class;?>'>
		<?php
				echo suffusion_get_image(array('mag-headline' => true));
		?>
				</div>
		<?php
			}
		?>
			</div>
		</section><!-- /.suf-mag-headlines -->
		<?php
	}
	else if ($suf_mag_excerpts_enabled == 'show' && $entity == 'excerpts') {
		$queries = suffusion_get_mag_section_queries(array('meta_check_field' => 'suf_magazine_excerpt', 'category_prefix' => 'suf_mag_excerpt_categories'));
		$total = 0;
		foreach ($queries as $query) {
			if (isset($query->posts) && is_array($query->posts)) {
				$total += count($query->posts);
			}
		}
		if ($total > 0) {
			global $suf_mag_excerpts_per_row, $suf_mag_excerpts_title, $suf_mag_total_excerpts;
			echo "<section class='suf-mag-excerpts suf-mag-excerpts-$suf_mag_excerpts_per_row'>\n";

			if (trim($suf_mag_excerpts_title) != '') {
				global $suf_mag_excerpts_main_title_alignment;
				echo "<div class='suf-mag-excerpts-header $suf_mag_excerpts_main_title_alignment'>".stripslashes($suf_mag_excerpts_title)."</div>";
			}

			$ctr = 0;
			$cols_per_row = $suf_mag_excerpts_per_row;
			foreach ($queries as $query) {
				if (isset($query->posts) && is_array($query->posts)) {
					$num_results = count($query->posts);
					while ($query->have_posts()) {
						if ($ctr >= $suf_mag_total_excerpts) {
							break;
						}
						$query->the_post();
						if ($ctr%$suf_mag_excerpts_per_row == 0) {
							if ($total - 1 - $ctr < $suf_mag_excerpts_per_row) {
								$cols_per_row = $total - $ctr;
							}
						}

						global $post, $suf_mag_excerpt_full_story_text, $suf_mag_excerpts_images_enabled, $suf_mag_excerpt_full_story_position, $suf_mag_excerpt_title_alignment;
						echo "\n\t<div class='suf-mag-excerpt entry-content suf-tile-{$cols_per_row}c $suf_mag_excerpt_full_story_position'>\n";

						$image_link = suffusion_get_image(array('mag-excerpt' => true));
						$topmost = 'suf-tile-topmost';
						if (($suf_mag_excerpts_images_enabled == 'show') || ($suf_mag_excerpts_images_enabled == 'hide-empty' && $image_link != '')) {
							echo "\t\t<div class='suf-mag-excerpt-image $topmost'>".$image_link."</div>\n";
							$topmost = '';
						}
						echo "\t\t<h2 class='suf-mag-excerpt-title $topmost $suf_mag_excerpt_title_alignment'><a class='entry-title' rel='bookmark' href='".get_permalink($post->ID)."'>".get_the_title($post->ID)."</a></h2>\n";

						global $suffusion_byline_type;
						$suffusion_byline_type = 'mag_excerpt';
						get_template_part('custom/byline', 'tile');

						echo "\t\t<div class='suf-mag-excerpt-text entry-content'>\n";
						suffusion_excerpt();
						echo "\t\t</div>\n";

						if (trim($suf_mag_excerpt_full_story_text)) {
							echo "\t<div class='suf-mag-excerpt-footer'>\n";
							echo "\t\t<a href='".get_permalink($post->ID)."' class='suf-mag-excerpt-full-story'>$suf_mag_excerpt_full_story_text</a>";
							echo "\t</div>\n";
						}

						echo "\t</div>";
						$ctr++;
					}
					wp_reset_postdata();
				}
			}

			echo "</section>\n";
		}
	}
	else if ($suf_mag_categories_enabled == 'show' && $entity == 'categories') {
		$categories = suffusion_get_allowed_categories('suf_mag_catblock_categories');
		if ($categories != null && is_array($categories) && count($categories) > 0) {
			$total = count($categories);
			global $suf_mag_catblocks_per_row, $suf_mag_catblocks_title, $suf_mag_excerpt_full_story_position;
			echo "<section class='suf-mag-categories'>\n";

			if (trim($suf_mag_catblocks_title) != '') {
				global $suf_mag_catblocks_main_title_alignment;
				echo "\t\t<div class='suf-mag-categories-header $suf_mag_catblocks_main_title_alignment'>".stripslashes($suf_mag_catblocks_title)."</div>";
			}

			$ctr = 0;
			if (is_array($categories)) {
				$num_results = count($categories);
				$cols_per_row = $suf_mag_catblocks_per_row;
				foreach ($categories as $category) {
					if ($ctr%$suf_mag_catblocks_per_row == 0) {
						if ($total - 1 - $ctr < $suf_mag_catblocks_per_row) {
							$cols_per_row = $total - $ctr;
						}
					}

					global $suf_mag_catblocks_images_enabled, $suf_mag_catblocks_desc_enabled, $suf_mag_catblocks_posts_enabled, $suf_mag_catblocks_num_posts;
					global $suf_mag_catblocks_see_all_text, $suf_mag_catblocks_post_style, $suf_mag_catblocks_thumbnail_size, $suf_mag_catblocks_title_alignment;
					echo "";

					echo "\n\t<div class='suf-mag-category suf-tile-{$cols_per_row}c $suf_mag_excerpt_full_story_position'>\n";
					echo "\t<h2 class='suf-mag-category-title $suf_mag_catblocks_title_alignment'>".$category->cat_name;
					echo "</h2>";
					if ($suf_mag_catblocks_images_enabled != 'hide') {
						if (function_exists('get_cat_icon')) {
							$cat_icon = get_cat_icon('echo=false&cat='.$category->cat_ID);
							if (($suf_mag_catblocks_images_enabled == 'hide-empty' && trim($cat_icon) != '') || $suf_mag_catblocks_images_enabled == 'show') {
								echo "\t\t<div class='suf-mag-category-image'>";
								echo $cat_icon;
								echo "</div>\n";
							}
						}
					}
					if ($suf_mag_catblocks_desc_enabled == 'show') {
						echo '<div class="suf-mag-category-description">'.$category->category_description.'</div>';
					}
					if ($suf_mag_catblocks_posts_enabled == 'show') {
						$cat_args = array('cat' => $category->cat_ID, 'posts_per_page' => $suf_mag_catblocks_num_posts);
						if (function_exists('mycategoryorder')) {
							$cat_args['orderby'] = 'order';
						}

						$query = new WP_query($cat_args);
						if (isset($query->posts) && is_array($query->posts) && count($query->posts) > 0) {
							$ul_class = '';
							$li_class = '';
							if ($suf_mag_catblocks_post_style == 'magazine') {
								$ul_class = " class='suf-mag-catblock-posts' ";
								$li_class = " class='suf-mag-catblock-post' ";
							}
							else if ($suf_mag_catblocks_post_style == 'thumbnail' || $suf_mag_catblocks_post_style == 'thumbnail-excerpt') {
								$ul_class = " class='suf-posts-thumbnail' ";
								$li_class = " class='fix' ";
							}
							echo "<ul $ul_class>\n";
							while ($query->have_posts())  {
								$query->the_post();
								if ($suf_mag_catblocks_post_style == 'thumbnail') {
									$image = suffusion_get_image(array('widget-thumb' => 'widget-' . $suf_mag_catblocks_thumbnail_size));
									echo "<li class='fix'><div class='suf-widget-thumb'>" . $image . "</div><a href='" . get_permalink() . "' class='suf-widget-thumb-title'>" . get_the_title() . "</a></li>\n";
								}
								else if ($suf_mag_catblocks_post_style == 'thumbnail-excerpt') {
									$image = suffusion_get_image(array('widget-thumb' => 'widget-' . $suf_mag_catblocks_thumbnail_size));
									echo "<li class='fix'><div class='suf-widget-thumb'>" . $image . "</div><a href='" . get_permalink() . "' class='suf-widget-thumb-title'>" . get_the_title() . "</a>" . suffusion_excerpt(false, false, true, 'suffusion_excerpt_length_cat_block') . "</li>\n";
								}
								else {
									echo "<li $li_class><a href='" . get_permalink() . "' class='suf-mag-catblock-post'>" . get_the_title() . "</a></li>\n";
								}
							}
							echo "</ul>";
							wp_reset_postdata();
						}
					}
					if (trim($suf_mag_catblocks_see_all_text)) {
						echo "\t<div class='suf-mag-category-footer fix'>\n";
						echo "\t\t<a href='".get_category_link($category->cat_ID)."' class='suf-mag-category-all-posts'>$suf_mag_catblocks_see_all_text</a>";
						echo "\t</div>\n";
					}

					echo "\t</div>";
					$ctr++;
				}
			}

			echo "</section>\n";
		}
	}
}
?>
      </div><!-- content -->
    </div><!-- main col -->
	<?php get_footer(); ?>

Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Clean subpage

Post by Colin » 10 Jan 2017, 01:56

The Magazine template is one of the hardest to modify as it has a lot of coding in it.

If you look at this custom template from one of my sites it has only one line of non standard code in it. Note how I have changed the name of the template in the comments section.

Code: Select all

<?php
/**
 * Template Name: Edit User Profile
 *
 * Allow users to update their profiles from Frontend.
 *
 */


get_header();
?>

<div id="main-col">
    <?php
    suffusion_page_navigation();
    suffusion_before_begin_content();
    ?>
    <div id="content">
        <?php
        global $post;
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $original_post = $post;
                ?>
                <div <?php post_class('fix'); ?> id="post-<?php the_ID(); ?>">
                    <?php suffusion_after_begin_post(); ?>
                    <div class="entry-container fix">
                        <div class="entry fix">
                            <?php suffusion_content(); ?>
                        </div><!--/entry -->
                        <?php
//My custom code****
                        wpfep_show_profile();
//End of my custom code***
                        // Due to the inclusion of Ad Hoc Widgets the global variable $post might have got changed. We will reset it to the original value.
                        $post = $original_post;
                        suffusion_after_content();
                        ?>
                    </div><!-- .entry-container -->
                    <?php
                    suffusion_before_end_post();
                    comments_template();
                    ?>

                </div><!--/post -->

            <?php
            }
        }
        ?>
    </div></div>
<?php get_footer(); ?>
To get you magazine template working properly again I suggest you reinstall Suffusion.

For you custom page I suggest that you use my code above as the basis and start building from there.

lensv
Posts: 252
Joined: 28 Feb 2011, 04:02

Re: Clean subpage

Post by lensv » 10 Jan 2017, 03:42

OK...

By reinstalling, do you mean inactivate and then activate it again or do you mean to completely remove the theme? I'm running Wordpress in a multisite environment and since I have more sites depending on this theme I want to be a bit careful.

Locked