• Skip to main content
  • Skip to primary sidebar

Victor Font Consulting Group, LLC

The DEX Intranet Specialists

  • Home
  • Care Plans
    • Care Articles
    • Optional Subscriptions
  • Consultations
  • Products
    • Code Snippets
    • Public GitHub Repositories
    • Gist Snippets
    • Pastebin Snippets (Free)
    • Free Plugins
  • FAQs
  • Support
    • Graphic Design
  • Contact
    • Speakers
    • Portfolio
  • Resources
    • Free WordPress Video Training
    • Tutorials
    • Articles
    • Cybersecurity
    • EU Referral Network

Add Widget Areas to News Pro Theme

September 28, 2015 By Victor M. Font Jr.

Add Widget Areas to News Pro Theme, public domain image courtesy of pixabay.com
A user writes:

Is it possible for me to achieve the following with the News Pro theme?

  1. Add a Home Center widget area below the Home Left and Home Right which would cover the whole length of the above two widgets combined
  2. Repeat the Home Left and Home Right widget just below the Home Center widget

Yes, not only is it possible, this is the same process to follow for any Studio Press theme.

First you need to register the widget areas. Add this to functions.php:

genesis_register_sidebar( array(
	'id'          => 'home-center',
	'name'        => __( 'Home - center', 'news' ),
	'description' => __( 'This is the center section of the homepage.', 'news' ),
) );
genesis_register_sidebar( array(
	'id'          => 'home-middle-left-2',
	'name'        => __( 'Home - Middle Left 2', 'news' ),
	'description' => __( 'This is the second middle left section of the homepage.', 'news' ),
) );
genesis_register_sidebar( array(
	'id'          => 'home-middle-right-2',
	'name'        => __( 'Home - Middle Right 2', 'news' ),
	'description' => __( 'This is the second middle right section of the homepage.', 'news' ),
) );

Next, you have to modify the home page. Open front-page.php and replace it with this code:

 '
', 'after' => '
', ) ); } function news_homepage_widgets() { if ( is_active_sidebar( 'home-middle-left' ) || is_active_sidebar( 'home-middle-right' ) ) { echo '
'; genesis_widget_area( 'home-middle-left', array( 'before' => '
', 'after' => '
', ) ); genesis_widget_area( 'home-middle-right', array( 'before' => '
', 'after' => '
', ) ); echo '
'; } if ( is_active_sidebar( 'home-center' ) ) { genesis_widget_area( 'home-center', array( 'before' => '
', 'after' => '
', ) ); } if ( is_active_sidebar( 'home-middle-left-2' ) || is_active_sidebar( 'home-middle-right-2' ) ) { echo '
'; genesis_widget_area( 'home-middle-left-2', array( 'before' => '
', 'after' => '
', ) ); genesis_widget_area( 'home-middle-right-2', array( 'before' => '
', 'after' => '
', ) ); echo '
'; } genesis_widget_area( 'home-bottom', array( 'before' => '
', 'after' => '
', ) ); } genesis();

Last you have to apply the CSS.

Find the classes for the home page in style.css around line 1287 and replace them with this:

/* Home Page
--------------------------------------------- */

.home-top {
	background-color: #f3f3f3;
	border-bottom: 1px solid #e3e3e3;
	clear: both;
	padding: 20px 20px 0;
}

.home-top .featured-content .entry-title {
	font-size: 30px;
}

.home-middle-left,
.home-middle-left-2 {
	border-right: 1px solid #e3e3e3;	
	float: left;
	padding: 20px 20px 0;
	width: 50%;
}

.home-middle-right,
.home-middle-right-2 {
	float: right;
	padding: 20px 20px 0;
	width: 50%;
}

.home-bottom,
.home-center {
	border-top: 1px solid #e3e3e3;
	clear: both;
	padding: 20px 20px 0;
}
  • 14shares
  • Facebook0
  • Twitter0
  • Pinterest0
  • LinkedIn14
  • Print
  • SMS0

Filed Under: Child Themes, Code Snippet, Genesis, Programming, Tutorial, WordPress Tagged With: Child Themes, Code Snippet, Genesis, Programming, WordPress

About Victor M. Font Jr.

Victor M. Font Jr. is an award winning author, entrepreneur, and Senior IT Executive. A Founding Board Member of the North Carolina Executive Roundtable, he has served on the Board of Advisors, of the North Carolina Technology Association, the International Institute of Business Analysis, Association of Information Technology Professionals, Toastmasters International, and the North Carolina Commission for Mental Health, Developmental Disabilities, and Substance Abuse Services. He is author of several books including The Ultimate Guide to the SDLC and Winning With WordPress Basics, and Cybersecurity.

Primary Sidebar

Shopping Cart

Books

  • Winning With WordPress Basics 2nd Edition Winning With WordPress Basics 2nd Edition $19.95
  • Ultimate Guide to the SDLC front cover The Ultimate Guide to the SDLC
    Rated 5.00 out of 5
    $74.95

Recent Articles

  • Modern Scam Defense: How Consumers and Businesses Can Recognize and Stop Email, Phone, and Text Fraud
  • How to Write a PRD So Dense It’s Technically a Novel
  • Top 5 Plugin Names That Scare Our Legal Department
  • When Agile Meets Our 3-Year Waterfall Roadmap: A Love Story
  • Why Our Enterprise Needs 27 Stakeholders to Approve a Button Color Change

Top 10 Article Categories

Best Practice Code Snippet Computers and Internet Genesis How To Leadership Programming Servant Leadership Tutorial WordPress

 
We only use analytical cookies on our website that allow us to recognize and count the number of visitors, but they do not identify you individually. They help us to improve the way our website works. By clicking Accept you, agree to cookies being used in accordance with our Cookie Policy.