Meni
Natrag
Prijava
i registracija
Natrag

:fire: CJENOVNA BOMBA :bomb: 10 kg boila LT Baits + booster u vrijednosti od 4,57 € samo za 29,74 € :point_right::skin-tone-2: kupite OVDJE

10% popust

Podmetač Mikado S2-LU70211 2,10m

22,09 € -10%
Povijest cijena
1. Tropska cijena proizvoda: 19,94 € -10%
2. Prodajna cijena proizvoda: 22,09 €
19,94 €
Ti spremi 2,15 €
Šaljemo za 5-7 radnih dana

Opis Podmetač Mikado S2-LU70211 2,10m

Moderni podmetač izrađen od visoko otpornih materijala.

Novost je upotreba metalnog spoja ručke i okvira podmetača.

Do tada proizvedeni plastični spojevi bili su najslabiji dio cijelog podmetača.

Sama ručka i okvir izrađeni su od ojačanog duraluminija, zahvaljujući čemu je cijeli podmetač iznimno lagan, a ipak vrlo otporan.

 Cjelina je presvučena (pod visokim tlakom) specijalnom zaštitnom površinom.

Premaz ne daje podmetaču samo elegantan izgled, već istovremeno osigurava cijelu konstrukciju.

Ne upija vodu.

```​Out of the box, the `wp_list_pages` function in WordPress doesn’t allow you to exclude pages by their custom field values. However, you can achieve this by using the `wp_list_pages_excludes` filter. This filter allows you to modify the list of excluded page IDs before the function generates the HTML. In this tutorial, we will show you how to exclude pages from `wp_list_pages` based on a custom field value.

Step 1: Add a Custom Field to Your Pages

First, you need to add a custom field to the pages you want to exclude. For example, you can create a custom field named `exclude_from_list` and set its value to `1` for the pages you want to hide.

Step 2: Add the Filter to Your theme’s functions.php File

Next, add the following code to your theme’s `functions.php` file. This code will fetch all pages that have the `exclude_from_list` custom field set to `1` and add their IDs to the exclusion list. /** * Exclude pages from wp_list_pages based on a custom field value. * * @param array $exclude_array The current array of excluded page IDs. * @return array The modified array of excluded page IDs. */ function exclude_pages_by_custom_field( $exclude_array ) { // Query for pages with the custom field 'exclude_from_list' set to '1' $args = array( 'post_type' => 'page', 'meta_query' => array( array( 'key' => 'exclude_from_list', 'value' => '1', 'compare' => '=' ) ), 'fields' => 'ids', // Only get the IDs 'posts_per_page' => -1, // Get all matching pages ); $query = new WP_Query( $args ); if ( ! empty( $query->posts ) ) { // Merge the found IDs with the existing exclude array $exclude_array = array_merge( $exclude_array, $query->posts ); } return $exclude_array; } add_filter( 'wp_list_pages_excludes', 'exclude_pages_by_custom_field' );

How the Code Works

  • `wp_list_pages_excludes` Filter: This filter is triggered whenever `wp_list_pages` is called. It passes an array of page IDs that are already set to be excluded.
  • `WP_Query`: We use `WP_Query` to find all pages where the custom field `exclude_from_list` is equal to `1`.
  • `fields => ids`: This argument ensures that the query only returns the IDs of the pages, which is more efficient than fetching the full post objects.
  • `array_merge`: We merge the IDs found by our query with any IDs that might already be in the `$exclude_array` (e.g., IDs passed directly to the `exclude` parameter of `wp_list_pages`).

Usage

Once you’ve added the code, any page with the custom field `exclude_from_list` set to `1` will automatically be excluded from the output of `wp_list_pages`, regardless of where it is called in your theme.

Conclusion

Using the `wp_list_pages_excludes` filter is a clean and efficient way to dynamically exclude pages from your navigation menus or page lists based on custom metadata. This approach is much more flexible than hardcoding page IDs, especially as your site grows. For more WordPress tips and tricks, check out our other tutorials! If you have any questions or need further assistance, feel free to leave a comment below. Happy coding! 🚀

Further Reading

Opis je automatski preveden, ispričavamo se zbog grešaka u tekstu.

Pogledajte puni opis
Proizvod se nalazi u kategorijama
  • Šifra proizvoda S2-LU70211
  • Proizvođač Mikado
  • Jamstvo 24 mjeseca
Parametri
  • Dužina mreže za ribolov: 2,10m
  • Dimenzije glave: 62x72cm
  • Transportna dužina: 87cm
  • Broj dijelova: 2
  • Tip podmetača: spinerski

Sljedeći podmetači od značky Mikado

Najprodavaniji u kategoriji

6 razlogan zašto
kupovati kod nas

  • Dostava na adresu s online plaćanjem ili pouzećem

  • Osnovano 2000. godine - tradicija prodaje 26 godina

  • Mogućnost kupnje na rate

  • Mogućnost povrata robe unutar 14 dana

  • Najširi asortiman - više od 100 000 proizvoda u ponudi

  • Razumijemo se u pecanje - u ekipi je i svjetski prvak