Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gasap
wp
Commits
682052a8
Commit
682052a8
authored
Feb 08, 2017
by
agnez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event calendar
parent
a0c877b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
60 deletions
+108
-60
plugins/gasap-posttypes/gasap-posttypes.php
plugins/gasap-posttypes/gasap-posttypes.php
+27
-27
themes/tm-beans-child4gasap/assets/less/gasap.less
themes/tm-beans-child4gasap/assets/less/gasap.less
+8
-0
themes/tm-beans-child4gasap/assets/less/images/trois_etapes_separator.png
...child4gasap/assets/less/images/trois_etapes_separator.png
+0
-0
themes/tm-beans-child4gasap/functions.php
themes/tm-beans-child4gasap/functions.php
+5
-17
themes/tm-beans-child4gasap/home.php
themes/tm-beans-child4gasap/home.php
+68
-9
themes/tm-beans-child4gasap/page-87.php
themes/tm-beans-child4gasap/page-87.php
+0
-7
No files found.
plugins/gasap-posttypes/gasap-posttypes.php
View file @
682052a8
...
...
@@ -318,32 +318,31 @@ add_filter( 'radio-buttons-for-taxonomies-no-term-gasaptype', '__return_FALSE' )
add_filter
(
'radio-buttons-for-taxonomies-no-term-gasapday'
,
'__return_FALSE'
);
// ---rename Post to News http://revelationconcept.com/wordpress-rename-default-posts-news-something-else/
function
gasap_change_post_label
()
{
global
$menu
;
global
$submenu
;
$menu
[
5
][
0
]
=
__
(
'News'
,
'gasap-posttypes'
);
$submenu
[
'edit.php'
][
5
][
0
]
=
__
(
'News'
,
'gasap-posttypes'
);
$submenu
[
'edit.php'
][
10
][
0
]
=
__
(
'Add News'
,
'gasap-posttypes'
);
$submenu
[
'edit.php'
][
16
][
0
]
=
__
(
'News Tags'
,
'gasap-posttypes'
);
echo
''
;
}
function
gasap_change_post_object
()
{
global
$wp_post_types
;
$labels
=
&
$wp_post_types
[
'post'
]
->
labels
;
$labels
->
name
=
_x
(
'News'
,
'post type general name'
,
'gasap-posttypes'
);
$labels
->
singular_name
=
_x
(
'News'
,
'post type singular name'
,
'gasap-posttypes'
);
$labels
->
add_new
=
_x
(
'Add New'
,
'News'
,
'gasap-posttypes'
);
$labels
->
add_new_item
=
__
(
'Add News'
,
'gasap-posttypes'
);
$labels
->
edit_item
=
__
(
'Edit News'
,
'gasap-posttypes'
);
$labels
->
new_item
=
__
(
'News'
,
'gasap-posttypes'
);
$labels
->
view_item
=
__
(
'View News'
,
'gasap-posttypes'
);
$labels
->
search_items
=
__
(
'Search News'
,
'gasap-posttypes'
);
$labels
->
not_found
=
__
(
'No News found'
,
'gasap-posttypes'
);
$labels
->
not_found_in_trash
=
__
(
'No News found in Trash'
,
'gasap-posttypes'
);
$labels
->
all_items
=
__
(
'All'
,
'gasap-posttypes'
);
$labels
->
menu_name
=
__
(
'News'
,
'gasap-posttypes'
);
$labels
->
name_admin_bar
=
__
(
'News'
,
'gasap-posttypes'
);
}
function
gasap_change_post_label
()
{
global
$menu
;
global
$submenu
;
$menu
[
5
][
0
]
=
__
(
'News'
,
'gasap-posttypes'
);
$submenu
[
'edit.php'
][
5
][
0
]
=
__
(
'News'
,
'gasap-posttypes'
);
$submenu
[
'edit.php'
][
10
][
0
]
=
__
(
'Add News'
,
'gasap-posttypes'
);
//$submenu['edit.php'][16][0] = __( 'News Tags', 'gasap-posttypes' );
}
function
gasap_change_post_object
()
{
global
$wp_post_types
;
$labels
=
&
$wp_post_types
[
'post'
]
->
labels
;
$labels
->
name
=
_x
(
'News'
,
'post type general name'
,
'gasap-posttypes'
);
$labels
->
singular_name
=
_x
(
'News'
,
'post type singular name'
,
'gasap-posttypes'
);
$labels
->
add_new
=
_x
(
'Add New'
,
'News'
,
'gasap-posttypes'
);
$labels
->
add_new_item
=
__
(
'Add News'
,
'gasap-posttypes'
);
$labels
->
edit_item
=
__
(
'Edit News'
,
'gasap-posttypes'
);
$labels
->
new_item
=
__
(
'News'
,
'gasap-posttypes'
);
$labels
->
view_item
=
__
(
'View News'
,
'gasap-posttypes'
);
$labels
->
search_items
=
__
(
'Search News'
,
'gasap-posttypes'
);
$labels
->
not_found
=
__
(
'No News found'
,
'gasap-posttypes'
);
$labels
->
not_found_in_trash
=
__
(
'No News found in Trash'
,
'gasap-posttypes'
);
$labels
->
all_items
=
__
(
'All'
,
'gasap-posttypes'
);
$labels
->
menu_name
=
__
(
'News'
,
'gasap-posttypes'
);
$labels
->
name_admin_bar
=
__
(
'News'
,
'gasap-posttypes'
);
}
add_action
(
'admin_menu'
,
'gasap_change_post_label'
);
add_action
(
'init'
,
'gasap_change_post_object'
);
...
...
@@ -388,6 +387,7 @@ function gasap_add_usage_taxonomy() {
unset
(
$menu
[
4
]);
unset
(
$menu
[
10
]);
unset
(
$menu
[
20
]);
add_menu_page
(
__
(
'Event'
,
'gasap-posttypes'
),
'Event'
,
'page'
,
'edit.php?post_type=event'
,
''
,
''
,
5
);
if
(
!
current_user_can
(
'manage_options'
)
){
remove_menu_page
(
'tools.php'
);
remove_submenu_page
(
'edit.php?post_type=gasap'
,
'edit-tags.php?taxonomy=gasaptype&post_type=gasap'
);
...
...
@@ -545,7 +545,7 @@ function gasap_remove_post_meta_boxes() {
}
/**
* Rename author meta boxes in GASAP poste ty
o
es
* Rename author meta boxes in GASAP poste ty
p
es
*/
add_action
(
'add_meta_boxes_gasap'
,
'gasap_rename_metabox'
);
function
gasap_rename_metabox
(
$post
)
{
...
...
themes/tm-beans-child4gasap/assets/less/gasap.less
View file @
682052a8
...
...
@@ -256,6 +256,14 @@ main .uk-container{
background-color: @bleu-ciel;
padding: 3em 0;
}
#snippet_event_calendar{
background-color: @bleu-ciel;
padding: 1em 0;
margin-bottom: 3em;
.uk-panel{
background-color: white;
}
}
#gasap-footer{
background-color: @global-muted-color;
color: white;
...
...
themes/tm-beans-child4gasap/assets/less/images/trois_etapes_separator.png
0 → 100644
View file @
682052a8
154 Bytes
themes/tm-beans-child4gasap/functions.php
View file @
682052a8
...
...
@@ -97,23 +97,11 @@ function wp_get_attachment( $attachment_id ) {
);
}
// Register c
ustom widget area.
add_action
(
'widgets_init'
,
'
example
_widget_areas'
);
function
example
_widget_areas
()
{
// Register c
alendar widget area to use in home.php
add_action
(
'widgets_init'
,
'
calendar
_widget_areas'
);
function
calendar
_widget_areas
()
{
beans_register_widget_area
(
array
(
'name'
=>
__
(
'
Example
Widget Area'
,
'beans_gasap'
),
'id'
=>
'
example
_widget_area'
,
'name'
=>
__
(
'
Calendar
Widget Area'
,
'beans_gasap'
),
'id'
=>
'
calendar
_widget_area'
,
)
);
}
// Append custom HTML to the Primary Sidebar.
add_action
(
'beans_sidebar_primary_append_markup'
,
'example_widget_area_custom_html'
);
function
example_widget_area_custom_html
()
{
?>
<div
class=
"uk-panel"
>
ggggggggggggggggggggggggggg
</div>
<?php
}
// Append custom widget area to the Primary Sidebar.
add_action
(
'beans_sidebar_primary_append_markup'
,
'example_custom_widget_area'
);
function
example_custom_widget_area
()
{
echo
beans_widget_area
(
'example_widget_area'
);
}
\ No newline at end of file
themes/tm-beans-child4gasap/home.php
View file @
682052a8
...
...
@@ -9,12 +9,12 @@ add_action( 'beans_content_prepend_markup', 'gasap_latest_news' );
function
gasap_latest_news
()
{
$do_not_duplicate
=
array
();
?>
<article
id=
"snippet_latest_news"
class=
"uk-article"
>
<?php
$latest_news
=
new
WP_Query
(
array
(
'post_type'
=>
'post'
,
'orderby'
=>
'post_date'
,
'order'
=>
'DESC'
,
'posts_per_page'
=>
1
));
$latest_news
=
new
WP_Query
(
array
(
'post_type'
=>
'post'
,
'orderby'
=>
'post_date'
,
'order'
=>
'DESC'
,
'posts_per_page'
=>
1
));
while
(
$latest_news
->
have_posts
()
)
:
$latest_news
->
the_post
();
$do_not_duplicate
[]
=
get_the_ID
();
?>
<div>
...
...
@@ -26,8 +26,10 @@ function gasap_latest_news() {
</div>
<a
class=
"uk-position-cover"
href=
"
<?php
echo
get_the_permalink
();
?>
"
></a>
</figure>
<div>
<?php
the_content
();
?>
</div>
<?php
edit_post_link
(
esc_html__
(
'Edit news'
,
'beans_gasap'
),
'<span class="edit-link">'
,
'</span>'
);
?>
<div
class=
"largeur1"
>
<div>
<?php
the_content
();
?>
</div>
<?php
edit_post_link
(
esc_html__
(
'Edit news'
,
'beans_gasap'
),
'<span class="edit-link">'
,
'</span>'
);
?>
</div>
</div>
<?php
endwhile
;
wp_reset_postdata
();
?>
...
...
@@ -42,7 +44,7 @@ $loop2 = new WP_Query( array(
'posts_per_page'
=>
3
,
'post__not_in'
=>
$do_not_duplicate
));
?>
<div
class=
"uk-grid uk-grid-small largeur
2
"
data-uk-grid-margin
>
<?php
<div
class=
"uk-grid uk-grid-small largeur
1
"
data-uk-grid-margin
>
<?php
while
(
$loop2
->
have_posts
()
)
:
$loop2
->
the_post
();
$random_number
=
wp_rand
(
1
,
3
);
?>
<div
class=
"uk-width-1 uk-width-small-1-2 uk-width-medium-1-3"
>
...
...
@@ -61,10 +63,67 @@ $loop2 = new WP_Query( array(
wp_reset_postdata
();
?>
</div>
</section>
<?php
}
add_action
(
'beans_content_after_markup'
,
'calendar_section_with_widget_area'
);
function
calendar_section_with_widget_area
()
{
$argsevent_one
=
array
(
'post_type'
=>
'event'
,
'posts_per_page'
=>
1
,
'orderby'
=>
'eventstart'
,
'event_end_after'
=>
'now'
,
'order'
=>
'ASC'
);
$argsevents
=
array
(
'post_type'
=>
'event'
,
'offset'
=>
1
,
'posts_per_page'
=>
2
,
'orderby'
=>
'eventstart'
,
'event_end_after'
=>
'now'
,
'order'
=>
'ASC'
);
$event_one
=
new
WP_Query
(
$argsevent_one
);
$events
=
new
WP_Query
(
$argsevents
);
?>
<section
id=
"snippet_event_calendar"
>
<h2>
<?php
esc_html_e
(
'Calendrier'
,
'beans_gasap'
);
?>
</h2>
<div
class=
"uk-grid uk-grid-small uk-grid-match largeur1"
data-uk-grid-match
>
<div
class=
"uk-width-1 uk-width-medium-1-3"
>
<div
class=
"uk-panel"
>
<?php
echo
beans_widget_area
(
'calendar_widget_area'
);
// Output widget area above the footer. ?></div>
</
div
><?
php
while
(
$event_one
->
have_posts
()
)
:
$event_one
->
the_post
();
?>
<div
class=
"uk-width-1 uk-width-medium-1-3"
>
<div
class=
"uk-panel"
>
<?php
if
(
has_post_thumbnail
()
)
{
the_post_thumbnail
();
}
?>
</div>
</div>
<div
class=
"uk-width-1 uk-width-small-1-3"
>
<div
class=
"uk-panel"
>
<h3>
<?php
the_title
();
?>
</h3>
<?php
the_content
();
edit_post_link
(
esc_html__
(
'Edit snippet'
,
'beans_gasap'
),
'<span class="edit-link">'
,
'</span>'
);
?>
</div>
</div>
<?php
endwhile
;
while
(
$events
->
have_posts
()
)
:
$events
->
the_post
();
?>
<div
class=
"uk-width-1 uk-width-small-1-2"
>
<div
class=
"uk-panel"
>
<h3>
<?php
the_title
();
?>
</h3>
<?php
the_content
();
edit_post_link
(
esc_html__
(
'Edit snippet'
,
'beans_gasap'
),
'<span class="edit-link">'
,
'</span>'
);
?>
</div>
</div>
<?php
endwhile
;
wp_reset_postdata
();
?>
</div>
</section>
<?php
}
beans_remove_action
(
'beans_loop_template'
);
add_action
(
'beans_content_after_markup'
,
'gasap_bottom'
);
function
gasap_bottom
()
{
include
(
get_stylesheet_directory
()
.
'/assets/template_parts/contact_calendar.php'
);
...
...
themes/tm-beans-child4gasap/page-87.php
View file @
682052a8
...
...
@@ -37,13 +37,6 @@ function page_contact_before() {
</div>
</div></article>
TEST
<?php
if
(
dynamic_sidebar
(
'sidebar_primary'
)
)
:
else
:
endif
;
?>
<?php
if
(
dynamic_sidebar
(
'example_widget_area'
)
)
:
else
:
endif
;
?>
<?php
echo
todays_events
();
?>
<?php
echo
upcoming_events
();
?>
TEST
<article
id=
"snippet_contact_prod"
>
<div
class=
"uk-text-center"
>
<?php
$contact_producteurs
=
new
WP_Query
(
array
(
'post_type'
=>
'contentpiece'
,
'p'
=>
692
)
);
//FIX db entry
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment