Wordpress

strona, post w WP

jeśli dana strona ma wyglądać tak jak już opracowany i zakodowany szablon, możemy posłużyć się poniższym kodem by zaciągnąć opracowany kod do pliku php danej...

icona custom post

w function.php lub tam gdzie definiujemy custom post type w jego definicji podajemy: function myTheme_init_posttypes(){ $event_args = array( 'labels' => array( 'name' =>...

Polylang

...

User avatar

pobranie zdjęcia, miniatury usera poprzez kod: <?php echo get_avatar( $author_id ); ?> <?php echo get_avatar( $id_or_email, $size, $default, $alt, $args );...

tytuł kategorii custom post

- <h2>Kategoria: <span><?php $term_list = wp_get_post_terms($post->ID, 'custom-category', array("fields" => "names")); echo $term_list;...

pobranie listy wpisów custom post

Wykaz wszystkich wpisów konkretnego Custom Post <?php $args = array( 'post_type' => 'custom_post_name', 'posts_per_page' => -1, 'orderby' =>...

ACF Images

images as Object <?php $image = get_field('fotografia_top'); ?> <img src="<?php echo $image; ?>" alt="<?php echo $image; ?>"...

pobranie wybranych wpisów na dowolną stronę – custom field Wpis – Post Object

dodajemy w panelu custom field Wpis - Post Object i w kodzie strony wstawiamy: <!-- start get data of post --> <?php $post_object = get_sub_field('your_field_name'); if(...

pobranie nazwy kategorii przez custom fields – taxonomy

w polu custom fields taxonomy odznaczamy single term object: <?php $term = get_field('taxonomy_field_name'); if( $term ): ?> <h2><?php echo $term->name;...

lista kategorii custom post

pobranie listy category name & link custom post <?php $args = array( 'taxonomy' => 'my-category', 'orderby' => 'name', 'order' => 'ASC', 'show_count'...

paginacja custom post WordPress

tworzenie pętli custom wpisów z podziałem ich wykazu na strony: <?php $args = array( 'post_type' => 'event', 'posts_per_page' => 16, 'orderby' => 'post_date',...

WPs REST API

Za pomocą WP REST API można pracować  z Wordpresem przy użyciu innych języków niż...

WordPress funkcje

wptexturize ( string $text, bool $reset = false ) - wstawia tekst z modyfikacją znaków wp_mail( $to, $subject, $message, $headers, $attachments ); - znajduje się w wp-includes -...

WP childs menu

<?php $theParent = wp_get_post_parent_id(get_the_ID()); $allPages = get_pages(array( 'child_of' => get_the_ID() )); if ($theParent or $allPages) { ?> <div...