custom style bestand erkent niet contact.php pagina ?

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Johannes davidian

johannes davidian

02/07/2022 21:54:10
Quote Anchor link
hallo,
deze is de code infunction.php :

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
add_action('init', 'my_register_styles');

function my_register_styles() {
    wp_register_style( 'auto-garage-style', get_template_directory_uri() . '/style.css' );    
    wp_register_style( 'auto-garage-contact-form', get_template_directory_uri() . '/contact-form.css' );

}
add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );

function my_enqueue_styles() {
    if ( is_front_page() ) {
        wp_enqueue_style( 'auto-garage-style' );
    } elseif ( is_page_template( 'contact.php' ) ) {        
        wp_enqueue_style( 'auto-garage-contact-form' );
    } else {
        wp_enqueue_style( 'auto-garage-style' );
    }
}


deze is de code in contact.php pagina :

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
 /* Template Name: Contact */
 
 ?>

<!DOCTYPE HTML>  
<html>

<style>
.error {color: #FF0000;}
</style>

    
<div class="container">
<form id="contact" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<h3>Quick Contact</h3>
<h4>Contact us today, and get reply with in 24 hours!</h4>
<fieldset>
      <input placeholder="Your name" type="text" tabindex="1" required="" autofocus=""></fieldset>
<fieldset>
      <input placeholder="Your Email Address" type="email" tabindex="2" required=""></fieldset>
<fieldset>
      <input placeholder="Your Phone Number" type="tel" tabindex="3" required=""></fieldset>
<fieldset>
      <input placeholder="Your Web Site starts with http://" type="url" tabindex="4" required=""></fieldset>
<fieldset>
      <textarea placeholder="Type your Message Here...." tabindex="5" required=""></textarea></fieldset>
<fieldset>
      <button name="submit" type="submit" id="contact-submit" data-submit="...Sending">Submit</button></fieldset>
</form></div>
</html>


de probleem is:
de contact.php pagina erkend niet de contact-form.css bestand.
ik heb paar keer voor zekerheid de cache van mij computer schoon gemaakt . maar het probleem blijft.
ik heb geprobeerd om link te maken van contact-form-css maar de probleem is hetzelfde.
dank u wel
 
PHP hulp

PHP hulp

28/03/2024 13:10:29
 
- Ariën  -
Beheerder

- Ariën -

02/07/2022 21:56:45
Quote Anchor link
En staat die wel in de HTML-broncode van de browser zelf?
 
Johannes davidian

johannes davidian

02/07/2022 22:10:46
Quote Anchor link
dank u wel ,
wat wilt u zeggen precies.
waar kan het fout zijn
 
- Ariën  -
Beheerder

- Ariën -

02/07/2022 22:14:42
Quote Anchor link
Dat die CSS-sheet misschien niet in je HTML staat.
 
Johannes davidian

johannes davidian

02/07/2022 22:25:22
Quote Anchor link
dank u wel ,
ik heb wel custom css (contact-form-css) net als u ziet boven in function.php.
css code is :

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*------contact-form
 */

* {
    margin:0;
    padding:0;
    box-sizing:border-box;
    -webkit-box-sizing:border-box;
    -moz-box-sizing:border-box;
    -webkit-font-smoothing:antialiased;
    -moz-font-smoothing:antialiased;
    -o-font-smoothing:antialiased;
    font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

.container {
    max-width:400px;
    width:100%;
    margin:0 auto;
    position:relative;
}

#contact input[type="text"], #contact input[type="email"], #contact input[type="tel"], #contact input[type="url"], #contact textarea, #contact button[type="submit"] { font:400 12px/16px "Open Sans", Helvetica, Arial, sans-serif; }

#contact {
    background:#F9F9F9;
    padding:25px;
    margin:50px 0;
}

#contact h3 {
    color: #F96;
    display: block;
    font-size: 30px;
    font-weight: 400;
}

#contact h4 {
    margin:5px 0 15px;
    display:block;
    font-size:13px;
}

fieldset {
    border: medium none !important;
    margin: 0 0 10px;
    min-width: 100%;
    padding: 0;
    width: 100%;
}

#contact input[type="text"], #contact input[type="email"], #contact input[type="tel"], #contact input[type="url"], #contact textarea {
    width:100%;
    border:1px solid #CCC;
    background:#FFF;
    margin:0 0 5px;
    padding:10px;
}

#contact input[type="text"]:hover, #contact input[type="email"]:hover, #contact input[type="tel"]:hover, #contact input[type="url"]:hover, #contact textarea:hover {
    -webkit-transition:border-color 0.3s ease-in-out;
    -moz-transition:border-color 0.3s ease-in-out;
    transition:border-color 0.3s ease-in-out;
    border:1px solid #AAA;
}

#contact textarea {
    height:100px;
    max-width:100%;
  resize:none;
}

#contact button[type="submit"] {
    cursor:pointer;
    width:100%;
    border:none;
    background:#0CF;
    color:#FFF;
    margin:0 0 5px;
    padding:10px;
    font-size:15px;
}

#contact button[type="submit"]:hover {
    background:#09C;
    -webkit-transition:background 0.3s ease-in-out;
    -moz-transition:background 0.3s ease-in-out;
    transition:background-color 0.3s ease-in-out;
}

#contact button[type="submit"]:active { box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.5); }

#contact input:focus, #contact textarea:focus {
    outline:0;
    border:1px solid #999;
}
::-webkit-input-placeholder {
 color:#888;
}
:-moz-placeholder {
 color:#888;
}
::-moz-placeholder {
 color:#888;
}
:-ms-input-placeholder {
 color:#888;
}


Toevoeging op 02/07/2022 22:26:08:

deze css en html code ziet in codepen

Toevoeging op 02/07/2022 22:46:41:

en het werkt ik heb het bestudeerd en getest.
 
- Ariën  -
Beheerder

- Ariën -

02/07/2022 22:48:43
Quote Anchor link
Het is dus opgelost?
 
Ozzie PHP

Ozzie PHP

03/07/2022 00:21:37
Quote Anchor link
Wat Ariën bedoelt is:

Open de pagina in je browser.

Klik met de rechtermuisknop en selecteer 'view source', 'view source code', 'bekijk broncode' of iets wat daarop lijkt. Als het goed is krijg je nu de code van de pagina te zien. Kijk nu of daar jouw css-bestand tussen staat.
 
Johannes davidian

johannes davidian

03/07/2022 19:36:07
Quote Anchor link
dank u wel ,
ik heb eindelijk gevonden het probleem.
om custom pagina te maken in wordpress u moet deze lijnen toevoegen in custom-page.php
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
 /* Template Name: Contact */
  
get_header();
the_content();
?>

<?php
get_footer();

[
/code]

dan ik heb het html code in de pagina  sectie van wordpress in contact pagina toegevoegd nadat ik heb onder template aan de rechte kant(widget) de optie custom-page.php gekozen welke is in mij geval contact.php .
het werkt prima.
 plus ik heb deze 2 lijnen voor 2 css files in function.php toegevoegd .
[
code]
wp_enqueue_style( 'auto-garage-style', get_stylesheet_uri(), array(), _S_VERSION );

wp_enqueue_style( 'auto-garage-contact-form-style', get_template_directory_uri() . '/contact-form.css' );

[
/code]

u kun zien op url :https://webdesignleren.com/contact/

maar er blijft een vraag voor mij voor deze code in function.php

[code]
add_action('init', 'my_register_styles');

function
my_register_styles() {
    wp_register_style( 'auto-garage-style', get_template_directory_uri() . '/style.css' );    
    wp_register_style( 'auto-garage-contact-form', get_template_directory_uri() . '/contact-form.css' );

}

add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );

function
my_enqueue_styles() {
    if ( is_front_page() ) {
        wp_enqueue_style( 'auto-garage-style' );
    }
elseif ( is_page_template( 'contact.php' ) ) {        
        wp_enqueue_style( 'auto-garage-contact-form' );
    }
else {
        wp_enqueue_style( 'auto-garage-style' );
    }
}


[
/code]
 
deze code boven is bedoeld custom css voor custom.php pagina maar het werkt niet ik heb in google voor oplossing gezocht voor deze code zonder resultaat ook in wordpress codec ik kunde niet een antwoord vinden.
ik heb 2 css files
1-style.css
2-contact-form.css
en ik heb deze 2 in condition geplaatst boven.
ik wil graag weten wat het fout kan zijn boven in function.php.
dank u wel
 
- Ariën  -
Beheerder

- Ariën -

03/07/2022 19:48:20
Quote Anchor link
Fix je code blok even.
 
Johannes davidian

johannes davidian

03/07/2022 20:20:39
Quote Anchor link
ten eerste ik heb beantwoordt de oplossing van het probleem na 2 dagen zoeken.
2- ik wil weten wat het fout kan zijn in de code dat ik heb gebruikt om contact-form.css richten naar contact.php pagina.
de code is:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
add_action('init', 'my_register_styles');

function my_register_styles() {
    wp_register_style( 'auto-garage-style', get_template_directory_uri() . '/style.css' );    
    wp_register_style( 'auto-garage-contact-form', get_template_directory_uri() . '/contact-form.css' );

}
add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );

function my_enqueue_styles() {
    if ( is_front_page() ) {
        wp_enqueue_style( 'auto-garage-style' );
    } elseif ( is_page_template( 'contact.php' ) ) {        
        wp_enqueue_style( 'auto-garage-contact-form' );
    } else {
        wp_enqueue_style( 'auto-garage-style' );
    }
}


het kan ook als iemand weet vergelijkbaar code om custom.css binden voor custom.page.php .
dank u wel
 
- Ariën  -
Beheerder

- Ariën -

03/07/2022 21:27:05
Quote Anchor link
- Ariën - op 03/07/2022 19:48:20:
Fix je code blok even.


Graag even aanpassen in je bericht van 19:36:07. Zet even netjes <?php en ?> om je PHP-code.
Gewijzigd op 03/07/2022 21:27:22 door - Ariën -
 
Johannes davidian

johannes davidian

03/07/2022 21:36:57
Quote Anchor link
ik heb geen ?> tag in my function.php
ook geen ?> tag in contact.php
 
- Ariën  -
Beheerder

- Ariën -

03/07/2022 21:41:10
Quote Anchor link
Johannes davidian op 03/07/2022 21:36:57:
ik heb geen ?> tag in my function.php
ook geen ?> tag in contact.php

Gaarne die in je code-blok van je bericht 19:36:07 toevoegen.
Dan is het topic ook weer leesbaar. Gelieve ook voortaan na het plaatsen van je bericht te kijken of je bericht er goed uitziet.
Gewijzigd op 03/07/2022 21:42:25 door - Ariën -
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.