Skip to content

Commit

Permalink
a couple things
Browse files Browse the repository at this point in the history
  • Loading branch information
j0hannr committed Mar 15, 2021
1 parent adb18cc commit 755c3d8
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 261 deletions.
4 changes: 2 additions & 2 deletions components/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'post_type' => 'anmerkungen',
'post_status' => 'publish',
),
'honeypot' => true,
'field_el' => 'div',
'post_content' => false,
'post_title' => false,
Expand All @@ -34,6 +35,5 @@
);
?>

<a class="button is-style-outline" href="<?php echo get_site_url(); ?>/anmerkungen">Zur Wunschliste
</a>
<a class="button is-style-outline" href="<?php echo get_site_url(); ?>/anmerkungen">Zur Wunschliste</a>
</div>
97 changes: 91 additions & 6 deletions setup/wordpress.md → setup/development-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,93 @@
# Wordpress Snippets
# ⚙️ Development Notes

## Query
## Image Sizes (Ratio)

### Loop Posts (list)
| Name | S | M | M(2) | M(3) | L |
| ------------- | ------- | ------- | ------- | ------- | ------- |
| Square 1:1 | 80x80 | 180x180 | 300x300 | - | 400x400 |
| Preview 4:3 | 160x120 | 200x150 | 400x300 | 600x450 | 800x600 |
| Landscape 2:1 | 400x200 | 750x375 | - | - | 970x485 |

## SEO

1. Descriptions: Description Atribut = Bierdeckeltext
2. Page Title
3. URL: arrenberg.de/projektname — VS — CUSTOM ALIAS — VS — arrenberg.de/projekte/Arrenberg-Farm
3. Robots.txt!! Crawlbare seiten indexieren
4. H1 H2 H3 P
5. [Prüfen](https://search.google.com/test/rich-results) von Rich markup möglichkeiten
6. Data Highlighter verwenden
7. Veraltete Navigationsseite mit fehlerhaften Links (Alte Links weiterleiten!)
8. Lasy load + Alt Text = z.b Copy Right oder Bildbeschreibung

[Google PageSpeed](https://developers.google.com/speed/pagespeed/insights/?hl=de&url=http%3A%2F%2Fap1.arrenberg.studio%2F)

## Matomo Event Tracking
[Basics](https://matomo.org/docs/event-tracking/)
[In Depth](https://developer.matomo.org/guides/tracking-javascript-guide)

```js
_paq.push(['trackEvent', 'Categories', 'Action', 'Name/Page URL', 1000]);
```
#### Tracked
* Share (social media buttons)
* Interaction (Energie Ampel, Slider)

#### Track Content

```js
_paq.push(['trackVisibleContentImpressions']);
```
```html
<div data-track-content>
<div data-content-piece="arrenberg wetter" >
</div>
</div>
```
#### Tracked
* Arrenberg Wetter
* List Card
* Footer

## Git Commands
#### Get Rid of all untracked changes
```bash
git stash
```

#### Update public branch from master
```s
git fetch
git checkout public
git reset --hard main
```

#### Go back in timelin
```bash
git fetch
git reset --hard *hash*
git push --force
```

#### Trash commits ahead
```bash
git push --force
```

#### Checkout any commit
```bash
git checkout <commit-id> .
```

## Recources
- [Embla Carousel](https://davidcetinkaya.github.io/embla-carousel/#installation)
- [Emoji Picker](https://github.com/OneSignal/emoji-picker)



## Noted Queries

#### Loop Posts (list)

```php
$args = array(
Expand All @@ -21,7 +106,7 @@ if ( have_posts() ) {
}
```

### Date
#### Date

#### Post Date
```php
Expand Down Expand Up @@ -72,7 +157,7 @@ wp media regenerate --allow-root

## Change Meta name
[Link](https://support.advancedcustomfields.com/forums/topic/changing-field-name-question/)
```mysql
```php
UPDATE wp_postmeta
SET meta_key='new_name'
where meta_key='old_name';
Expand All @@ -82,7 +167,7 @@ SET meta_key='_new_name'
where meta_key='_old_name';
```
[Other](https://support.advancedcustomfields.com/forums/topic/best-practice-for-changing-custom-fields/)
```mysql
```php
UPDATE wp_postmeta
SET meta_key = 'new_field_name'
WHERE meta_key = 'old_field_name';
Expand Down
92 changes: 92 additions & 0 deletions setup/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<h1 align="center">Quartiersplattform</h1>
<!-- <p align="center">Developing a Plattform for self Districts</p> -->

<p align="center">
<img src="https://img.shields.io/github/license/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square" alt="License"/>
<img src="https://img.shields.io/github/repo-size/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square" alt="Repo Size"/>
<img src="https://img.shields.io/github/commit-activity/w/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square" alt="Commits"/>
<img src="https://img.shields.io/tokei/lines/github/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square" alt="Lines of code"/>
<img src="https://img.shields.io/github/languages/code-size/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square" alt="Code Size"/>
</p>

<!-- ## Wordpress Snippets
![GitHub](https://img.shields.io/github/license/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square)
![GitHub repo size](https://img.shields.io/github/repo-size/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/studio-arrenberg/quartiersplattform?color=%230091FF&style=flat-square)
![Lines of code](https://img.shields.io/tokei/lines/github/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/studio-arrenberg/quartiersplattform?color=%23f7f7f7&style=flat-square) -->

## Theme Publication

1. [WordPress Coding Standards](https://codex.wordpress.org/WordPress_Coding_Standards)
2. [Theme Requirments](https://make.wordpress.org/themes/handbook/review/required/)
3. [Unit Test](https://codex.wordpress.org/Theme_Unit_Test)
4. [Review Process](https://make.wordpress.org/themes/handbook/review/)
5. Upload for Review

## Database Structure
#### Custom Post Types
* Projekte `projekte`
* Nachrichten `nachrichten`
* Veranstaltungen `veranstaltungen`
* Umfragen `umfragen`
* Anmerkungen `anmerkungen`
* Fragen `fragen`
* Angebote `angebote`

#### Taxonomys
* Projekte `projekt` in `nachrichten`, `veranstaltungen`, `umfragen`
* Status `anmerkungen_status` in `anmerkungen`
* SDG `sdg` in `projekte`

## Custom Functions
#### Link Card
```php
landscape_card($args); // iterate landscape card with wp query
landscape_card(null, 'Hallo Welt','Text....',get_site_url().'/wp-content/uploads/2020/05/CTL_Titelbild-1.jpg', '/veranstaltungen'); // without query
landscape_card(null, 'Hallo Welt','Text....',get_template_directory_uri().'/assets/images/400x200.png', '/veranstaltungen'); // without query
landscape_card($args, 'Geschichte', '', '', '/geschichten'); // combination Query and Manual
```
#### List Card
```php
list_card($args3, get_site_url().'/veranstaltungen', 'title', 'subtitle');
```
#### Slider
`slides` get multiplied by 2 for desktop
```php
slider($query, $type = 'card', $slides = '2', $dragfree = 'true');
slider($query, $type = 'square_card', $slides = '4', $dragfree = 'true');
slider($query,'landscape_card', '1','false');
```
#### Shorten
```php
shorten_title($text, $count = '55'); // für den title
get_excerpt($text, $count = '55'); // für den fließtext
```
#### Calendar Download
```php
calendar_download($post); // nur für veranstaltungen
```
#### Card List
```php
card_list($query);
```
#### Comment Counter
```php
comment_counter($post->ID);
```
#### Get owner of Post
Including projekts
```php
get_cpt_term_owner($post_ID, $term, $type = 'name');
```
#### Get Author of Post Type
Should be used in the Wordpress Loop
```php
get_author(true); // true for further detail
```
4 changes: 2 additions & 2 deletions setup/projekte.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function cptui_register_my_taxes_projekt() {
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'new_lines' => '',
'new_lines' => 'br',
),
array(
'key' => 'field_60017e90839ca',
Expand All @@ -180,7 +180,7 @@ function cptui_register_my_taxes_projekt() {
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'new_lines' => '',
'new_lines' => 'br',
),
array(
'key' => 'field_600180493ab1a',
Expand Down
76 changes: 38 additions & 38 deletions setup/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,44 +337,44 @@
'key' => 'group_6036d8ca6862b',
'title' => 'API-Schlüssel',
'fields' => array(
array(
'key' => 'field_603765b41a015',
'label' => 'Google Maps API Schlüssel',
'name' => 'google_maps_api',
'type' => 'text',
'instructions' => 'Trage hier deinen Google Maps API Schlüssel ein.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '50',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_6036d91042015',
'label' => 'Mapbox API Schlüssel',
'name' => 'mapbox_api',
'type' => 'text',
'instructions' => 'Trage hier deinen Mapbox API-Schlüssel ein.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '50',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
// array(
// 'key' => 'field_603765b41a015',
// 'label' => 'Google Maps API Schlüssel',
// 'name' => 'google_maps_api',
// 'type' => 'text',
// 'instructions' => 'Trage hier deinen Google Maps API Schlüssel ein.',
// 'required' => 0,
// 'conditional_logic' => 0,
// 'wrapper' => array(
// 'width' => '50',
// 'class' => '',
// 'id' => '',
// ),
// 'default_value' => '',
// 'placeholder' => '',
// 'prepend' => '',
// 'append' => '',
// 'maxlength' => '',
// ),
// array(
// 'key' => 'field_6036d91042015',
// 'label' => 'Mapbox API Schlüssel',
// 'name' => 'mapbox_api',
// 'type' => 'text',
// 'instructions' => 'Trage hier deinen Mapbox API-Schlüssel ein.',
// 'required' => 0,
// 'conditional_logic' => 0,
// 'wrapper' => array(
// 'width' => '50',
// 'class' => '',
// 'id' => '',
// ),
// 'default_value' => '',
// 'placeholder' => '',
// 'prepend' => '',
// 'append' => '',
// 'maxlength' => '',
// ),
array(
'key' => 'field_6036d8d042014',
'label' => 'Matomo API Schlüssel',
Expand Down
Loading

0 comments on commit 755c3d8

Please sign in to comment.