Lightweight, modular WordPress theme designed for small newsrooms. It mirrors the ObDC visual prototype with a focus on performance, accessibility, SEO, and an editorial workflow built around featured stories, a continuous feed, and audience ranking.
- WordPress 6.5 or newer (REST API enabled and pretty permalinks).
- PHP 8.0 or newer.
- Standard WordPress PHP extensions (curl, dom, gd).
- Permission to manage menus, widgets, and Customizer options.
The front page is organised in five blocks: persistent LIVE bar, hero (sticky post), secondary highlights, continuous feed with “load more”, and the “Mais lidas” column. Components live in template-parts/, making it easy to reuse them elsewhere. The theme is based on the Underscores (_s) boilerplate with newsroom-focused tweaks.
- Responsive-first layout with hero + cards using Inter/Merriweather via Google Fonts (
wp_resource_hints+font-display: swap). - LIVE ticker configurable in the Customizer (status, text, CNPJ, city).
- Persistent navigation: desktop main menu (
main) with optional one-level dropdown submenus, and mobile drawer menu (drawer) fully driven by WordPress menu locations (drawer falls back tomainif not set). - Editorial panel powered by sticky posts with automatic fallback to recent posts.
- Infinite feed driven by REST (
js/front-page.js) withIntersectionObserverand manual fallback. - Author archive with progressive loading (
js/author-feed.js) via the dedicated REST endpoint. - Search result pages reuse the same infinite-scroll behaviour as the home feed.
- “Mais lidas” sidebar based on the
post_viewsmeta key; fallback helpers exist ininc/helpers.php. - Ad slots ready in
template-parts/ads(top/home feed) and via widgets. - SEO: OG/Twitter cards (
inc/seo-meta.php), canonical links, and Schema.org structured data (inc/structured-data.php). - Accessibility enhancements (
inc/template-functions.php) and translation-ready strings (load_theme_textdomain). - Basic Jetpack integration stub (
inc/jetpack.php). - Restricted author archives: subscribers (and any roles filtered via
obdc_simplex_news_restricted_author_roles) receive 404 on author pages, and only profile editing is allowed in wp-admin.
- Zip the theme or clone it into
wp-content/themes. - In the WordPress dashboard go to
Appearance > Themes > Add New > Upload Theme. - Activate “ObDC Simplex News”.
- Visit
Settings > Permalinksand ensure pretty permalinks are enabled (required for the REST endpoints).
- Open
Appearance > Customize > Configurações do Temato configure the LIVE bar (status, CNPJ, city, YouTube API settings, fallback text). 2. Create menus for every registered location (main,drawer,footer-news,footer-brazil,footer-site,footer-opinion,footer-sports,footer-entertainment,footer-social). Thedrawerlocation feeds the mobile site-drawer; if left empty it falls back tomain. - Choose the sticky posts that will fill the hero and highlight slots.
- Install a post-views plugin (e.g. Post Views Counter) or call
obdc_simplex_news_increment_post_views()insingle.php. - Replace
screenshot.pngwith a 1200x900 preview for wp-admin. - Add
images/logo.pngandimages/og-default.jpgto feed SEO/meta defaults (adjust sizes as needed).
- Hero & highlights:
template-parts/home/hero.phpandtemplate-parts/home/highlights.phpconsumeobdc_simplex_news_get_front_page_featured_data()(cached sticky posts with exclusion list) and respect Yoast primary categories when the plugin is active. - Home feed:
front-page.phpbuilds the loop excluding featured IDs and exposes pagination data for JS. - Search:
search.phpmirrors the infinite-scroll structure, consuming the search REST endpoint. - Cards:
template-parts/content/card.phpdefines the standard feed card layout. - Mais lidas:
template-parts/sidebar/most-read.phpreadspost_views; change the meta key if needed. - LIVE bar:
template-parts/topbar.phprenders data from the YouTube integration (or fallback text) with animation. - Authors carousel:
template-parts/front-page/authors-carousel.phpdisplays data fromobdc_simplex_news_get_featured_authors(). Title defaults to “Equipe editorial” and can be filtered viaobdc_simplex_news_authors_heading.
js/front-page.js: manages “load more”, loading states,IntersectionObserver, and fallbacks. Reused on the home feed and search results.js/author-feed.js: extends the same behaviour to author archives.js/navigation.js,js/footer-accordion.js,js/share.js,js/authors-carousel.js,js/topbar.js: handle responsive menu/drawer, footer accordion, sharing utilities, authors carousel, and YouTube ticker overflow.js/main-menu.js: progressive enhancement for the main menu dropdowns (addsaria-haspopup/aria-expandedand improves focus handling on items with submenus).js/categories-index.js: client-side filter for the Categories Index template, hiding/revealing category cards as the user types in the search field.js/script.js: legacy AJAX load-more prototype (admin-ajax). Not enqueued; keep only as reference or remove during refactors.- REST endpoints registered in
functions.php(generated as relative URLs):GET /wp-json/obdc-simplex-news/v1/front-page-feed?page={n}GET /wp-json/obdc-simplex-news/v1/author-feed?author_id={ID}&page={n}(legacyauthor=still works for compatibility)GET /wp-json/obdc-simplex-news/v1/search-feed?search={query}&page={n}Each endpoint returns rendered HTML ready to inject in the DOM (load morescripts expect JSON withhtml,maxPages,foundPosts).
- Configurable autoload limits:
obdc_simplex_news_front_page_autoload_limit,obdc_simplex_news_author_autoload_limit,obdc_simplex_news_search_autoload_limit.
- See
LOCAL_DEV.mdfor Docker instructions (docker compose up -d). Defaults tohttp://192.168.15.8:8080; adjustWP_HOME/WP_SITEURLif needed. - No build step: CSS/JS are enqueued from
style.cssandjs/*.js. - Generate new translations with
wp i18n make-pottargeting the theme directory and output tolanguages/.
The single template includes a newsletter CTA block that is disabled by default. To re‑enable it:
- File:
single.php - Look for the section starting with
<section class="single-cta" ...>— it is wrapped by a PHP conditional used to disable rendering:
<?php if ( false ) : // CTA disabled intentionally; set to true or remove to enable ?>
<section class="single-cta" aria-label="<?php esc_attr_e( 'Assine nossa newsletter', 'obdc-simplex-news' ); ?>">
...
</section>
<?php endif; ?>- To enable the CTA, change
falsetotrueor remove the surroundingif/endifguard. - The button currently points to
home_url( '/newsletter' ); adjust this URL if your newsletter lives elsewhere.
.
|-- inc/ # Helpers, SEO, Customizer, schema
|-- js/ # Navigation, feeds, authors, share scripts
|-- template-parts/ # Reusable components (ads, cards, sidebar, etc.)
|-- author.php # Author archive with async feed
|-- front-page.php # Home with sticky posts + infinite feed
|-- functions.php # Theme supports, menus, REST endpoints
|-- search.php # Search results with infinite feed
|-- single.php # Full article layout
|-- style.css # Theme metadata & global styles
`-- README.md
GPL-2.0-or-later.
Samuel Pantoja — https://www.obrasildecima.com.br