Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Nowicjusz vs. PHP, Strona na Wordpressie
Merol
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 3.07.2015

Ostrzeżenie: (0%)
-----


Witam, znalazłem darmowy szablon php na Wordpress i zacząłem zabawę próbując dostosować go do swoich potrzeb.

Zacznę od podania linku do mojej strony na testowej domenie: http://agencjafresh.esy.es/
Chciałbym w wyszukiwarce ofert zastąpić "Type, Rooms, Area, Price" innymi słowami, z tym, że Price chciałbym ręcznie wpisywać od / do.

Próbowałem zmienić kolejno "Type" na "Typ transakcji" wszędzie w kodzie, ale wtedy wyszukiwarka się psuła. Być może dlatego, że słowo jest dwuczłonowe, ale nie jestem pewien.

Tak wygląda w tych miejscach kod:
functions.php
  1. function listings_taxonomy() {
  2. register_taxonomy(
  3. 'type',
  4. 'listings',
  5. 'hierarchical' => true,
  6. 'label' => 'Type',
  7. 'query_var' => true,
  8. 'rewrite' => array('slug' => 'type')
  9. )
  10. );

searchs-listings-form-sidebar.php
  1. <div class="sidebar-box search-listings <?php echo (is_page_template('home-page-template.php')) ? 'transp' : '';?>">
  2. <h3>Znajdź swój nowy dom:</h3>
  3. <form method="post" action="<?php bloginfo('url');?>/listing-search-results/">
  4. <div><?php echo buildSelect('type'); ?></div>
  5. <div><?php echo buildSelect('rooms'); ?></div>
  6. <div><?php echo buildSelect('area'); ?></div>
  7. <div><?php echo buildSelect('price'); ?></div>
  8. <div><input type="submit" class="button" /></div>
  9. </form>
  10. <div class="clear"></div>
  11. </div>

searchs-listings-form.php
  1. <div class="twelve columns listing-search">
  2. <h3>Możesz filtrować bazę ofert za pomocą poniższych pól wyboru:</h3>
  3. <div class="search-wrap <?php echo (is_page_template('home-page-template.php')) ? 'transp' : '';?>">
  4. <form method="post" action="<?php bloginfo('url');?>/listing-search-results/">
  5. <div class="two columns"><?php echo buildSelect('type'); ?></div>
  6. <div class="three columns"><?php echo buildSelect('rooms'); ?></div>
  7. <div class="three columns"><?php echo buildSelect('area'); ?></div>
  8. <div class="two columns"><?php echo buildSelect('price'); ?></div>
  9. <div class="two columns"><input type="submit" class="button" /></div>
  10. </form>
  11. </div>
  12. </div>

single-listings.php
  1. <div class="overview">
  2. <h6>Specyfikacja techniczna</h6>
  3. <ul>
  4. <?php echo get_the_term_list( $post->ID, 'type', '<li>Type: ', ', ', '</li>' ); ?>
  5. <?php echo get_the_term_list( $post->ID, 'rooms', '<li>Rooms: ', ', ', '</li>' ); ?>
  6. <?php echo get_the_term_list( $post->ID, 'area', '<li>Area: ', ', ', '</li>' ); ?>
  7. <?php echo get_the_term_list( $post->ID, 'price', '<li>Price: ', ', ', '</li>' ); ?>
  8. <li><a href="#respond">Contact Us</a> regarding this listing</li>
  9. </ul>
  10. </div>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
maniek74
post
Post #2





Grupa: Zarejestrowani
Postów: 127
Pomógł: 0
Dołączył: 26.08.2013

Ostrzeżenie: (0%)
-----


Witam
Przepraszam że się pytam ale po co pchasz się w gotowy szablon. Nie prościej napisać swój od początku. zasady wordpres sa proste:

plik header.php - tutaj piszesz górę strony
pliki page_cos tam.php - strony www
Template Name: home - nazwa szablonu

  1. <?php
  2. /**
  3.  * Template Name: home
  4.  *
  5.  */
  6.  
  7. get_header();
  8.  
  9. ?>
  10. <meta charset="utf-8">


pliki single_coś tam.php - wpisy
[oferta] - nazwa szablonu
  1. <?php
  2. /*
  3. Single Post Template: [oferta]
  4. Description: This part is optional, but helpful for describing the Post Template
  5. */
  6. ?>
  7. <?php get_header(); ?>
  8. <!-- Content start -->
  9.  
  10. <meta charset="utf-8">



wywal wszystko jak leci i dodaj pluginy
Advanced Custom Fields
Page Links To
Single Post Template
TinyMCE Advanced

i to wszystko jeśli znasz trochę php, html i css to dasz radę.

a jeszcze musisz mić plik
functions.php
gdzie sobie piszesz funkcje

np.
  1. <?php
  2. add_action('get_header', 'remove_admin_login_header');
  3. function remove_admin_login_header() {
  4. remove_action('wp_head', '_admin_bar_bump_cb');
  5. }
  6.  
  7. add_theme_support('post-thumbnails');
  8.  
  9.  
  10. function register_my_menus() {
  11. register_nav_menus(array('header-menu-left' => __('Header Menu Left'),
  12. 'header-menu-right' => __('Header Menu Right'),
  13. 'header-menu-mobile' => __('Header Menu Mobile'),
  14. 'footer-menu' => __('Footer Menu')));
  15. }
  16.  
  17. add_action('init', 'register_my_menus');
  18.  
  19. pll_register_string('RECEPCJA', 'text_reception', 'header');
  20. pll_register_string('BIURO', 'text_office', 'header');
  21. pll_register_string('RESTAURACJA', 'text_restaurant', 'header');
  22. pll_register_string('facebook', 'link_facebook', 'header');
  23. pll_register_string('google', 'link_google', 'header');
  24. pll_register_string('youtube', 'link_youtube', 'header');
  25. pll_register_string('twiter', 'link_twiter', 'header');
  26. pll_register_string('instagram', 'link_instagram', 'header');
  27. pll_register_string('skype', 'link_skype', 'header');
  28. pll_register_string('email', 'link_email', 'header');
  29. pll_register_string('ZAREZERWUJ SWÓJ POBYT ONLINE!', 'button_reservation', 'header');
  30. ?>


na prawdę wszystko jest proste jak nie to napisz na pw swój email to dam ci swój i Ci pomogę
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.10.2025 - 22:53