PHPackages                             piassi/solidpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. piassi/solidpress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

piassi/solidpress
=================

Solid foundation for wordpress themes

1.2.0(3y ago)3283MITPHP

Since Jun 22Pushed 3y ago3 watchersCompare

[ Source](https://github.com/piassi/solidpress)[ Packagist](https://packagist.org/packages/piassi/solidpress)[ RSS](/packages/piassi-solidpress/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (2)Versions (22)Used By (0)

SolidPress
==========

[](#solidpress)

A library that uses the best OOP practices to provide a solid project structure for component-based WordPress themes.

- [Installation](#installation)
- [Setup](#setup)
- [Handbook](#handbook)
    - [Registering a new post type](#registering-a-new-post-type)
    - [Creating a new custom fields group](#creating-a-new-custom-fields-group)

Installation
------------

[](#installation)

SolidPress is a [Composer](https://getcomposer.org/) and it's avaliable through [Packagist](https://packagist.org/packages/piassi/solidpress)

```
composer require piassi/solidpress

```

Setup
-----

[](#setup)

In "composer.json", setup a folder inside your theme as the root namespace

```
{
	"autoload": {
		"psr-4": {
			"App\\": "src/"
		}
	}
}
```

Init Solidpress in your functions.php

```
use SolidPress\Core\Theme;
use SolidPress\Core\WPTemplate;

// Composer autoload
require get_template_directory() . '/vendor/autoload.php';

$registrable_namespaces = [];

// Check if ACF plugin is active to register fields
if (function_exists('acf_add_local_field_group')) {
	$registrable_namespaces[] = 'FieldsGroup';
	$registrable_namespaces[] = 'Options';
}

// Set core registrables
$registrable_namespaces = array_merge($registrable_namespaces, [
	'Taxonomies',
	'PostTypes',
	'Hooks',
]);

// Setup a theme instance for SolidPress
global $theme_class;
$theme_class = new Theme([
	'template_engine' => new WPTemplate(),
	'namespace' => 'App',
	'base_folder' => 'src',
	'registrable_namespaces' => $registrable_namespaces,
	'theme_name' => 'solidpress-theme',
	'css_dist_path' => get_template_directory_uri() . '/dist/%s.css', // %s will be replaced with page bundle css file.
	'js_dist_path' => get_template_directory_uri() . '/dist/%s.js', // %s will be replaced with page bundle js file.
]);
```

> You can check [this theme](https://github.com/piassi/solidpress-theme) as a reference.

Handbook
--------

[](#handbook)

### Registrables

[](#registrables)

The *PostType*, *Taxonomy*, and *FieldGroup* classes extend the Registrable interface, those classes must have a constructor method that will be automatically called at site startup.

### Registering a new post type

[](#registering-a-new-post-type)

1. Create a new class inside the *PostTypes* namespace.
2. Set *post\_type* and *args* properties inside the constructor method, those properties will be forwarded to *register\_post\_type* function.

> See *register\_post\_type* [docs](https://developer.wordpress.org/reference/functions/register_post_type/) to see more details about the *args* property.

**Example**

Registering a new post type called "Products"

```
// Filepath: src/PostTypes/Products.php

namespace App\PostTypes;

use SolidPress\Core\PostType;

class Products extends PostType{
	public function __construct()
	{
		$this->post_type = "product";

		$labels = [
			"name" => "Products",
			"singular_name" => "Product",
			"menu_name" => "Products",
			"all_items" => "All Products",
			"add_new" => "Add new",
			"add_new_item" => "Add new product",
			"edit_item" => "Edit product",
			"new_item" => "New product",
			"view_item" => "View proct",
			"insert_into_item" => "Insert in product",
			"view_items" => "View products",
			"search_items" => "Search for products",
			"not_found" => "No products found",
			"not_found_in_trash" => "No products found in trash"
		];

		$this->args = [
			"label"               => "Products",
			"labels"              => $labels,
			"description"         => "",
			"public"              => true,
			"publicly_queryable"  => false,
			"show_ui"             => true,
			"show_in_rest"        => false,
			"rest_base"           => "",
			"has_archive"         => false,
			"show_in_menu"        => true,
			"exclude_from_search" => true,
			"capability_type"     => "post",
			"map_meta_cap"        => true,
			"hierarchical"        => false,
			"menu_position"       => 8,
			'rewrite'             => array("slug" => $this->post_type, "with_front" => false),
			'query_var'           => false,
			"supports"            => array("title", "editor", "revisions", "excerpt"),
			"menu_icon"           => 'dashicons-book-alt',
			"taxonomies"          => []
		];
	}
}
```

### Creating a new custom fields group

[](#creating-a-new-custom-fields-group)

1. Create a new class inside the *FieldsGroup* namespace, call *set\_fields* and set *args* inside the class constructor.
2. The *set\_fields* method receives has an array as an argument, the array key is the field name, and the value is a *Field* class instance.

**Example**

Creating a new fields group to *product* post type.

```
// Filepath: src/FieldsGroup/Product.php

namespace App\FieldsGroup;

use SolidPress\Core\FieldGroup;
use SolidPress\Core\PostType;
use SolidPress\Fields;

class Product extends FieldGroup{
	public function __construct() {
		// Set fields
		$this->set_fields([
			'product_detailts_tab' => new Fields\Tab('Product Details'),
			'value' => new Fields\Number('Value'),
			'subtitle' => new Fields\Text('Subtitle', [
				// You can pass an acf options array as the second argument
				'wrapper' => [
					'width' => 70
				]
			]),
			'gallery_thumbnail' => new Fields\Image('Gallery Thumbnail', [
				'wrapper' => [
					'width' => 30
				]
			])
		]);

		// Set arguments
		$this->args = [
			'key' => 'product-fields',
			'title' => 'Product Fields',
			'location' => [
				[
					// Pages, Taxonomies, OptionsPages, and PostTypes
					// classes have static methods for acf conditionals.
					PostType::is_equal_to('product'),
				],
			]
		];
	}
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~239 days

Total

20

Last Release

1136d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4440076?v=4)[Thales Piassi](/maintainers/piassi)[@piassi](https://github.com/piassi)

---

Top Contributors

[![piassi](https://avatars.githubusercontent.com/u/4440076?v=4)](https://github.com/piassi "piassi (54 commits)")

### Embed Badge

![Health badge](/badges/piassi-solidpress/health.svg)

```
[![Health](https://phpackages.com/badges/piassi-solidpress/health.svg)](https://phpackages.com/packages/piassi-solidpress)
```

###  Alternatives

[sanzgrapher/filament-draggable-modal

Make Filament modals draggable.

172.2k1](/packages/sanzgrapher-filament-draggable-modal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
