Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
wikitoki-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wikitoki
wikitoki-web
Commits
77aa6b7a
Commit
77aa6b7a
authored
Nov 29, 2019
by
numeroteca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove feeds if no user or feed is provided in Entidad page
parent
74b87e7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
60 deletions
+72
-60
content-entidad.php
content-entidad.php
+72
-60
No files found.
content-entidad.php
View file @
77aa6b7a
...
...
@@ -169,72 +169,84 @@ $entity_type_simple = $entity_type[0]->slug;
<!--
</ul>
-->
<h2
style=
"clear:both;"
>
Posts de
<?php
echo
$tit
;
?>
en Wikitoki.org:
</h2>
<ul>
<!-- The Loop of posts by author -->
<?php
$args
=
array
(
'post_type'
=>
'post'
,
//sets post type to "Project"
'order'
=>
'DESC'
,
'author'
=>
$web_user_id
,
'posts_per_page'
=>
-
1
,
);
$my_query
=
new
WP_Query
(
$args
);
$wp_count
=
$my_query
->
post_count
;
<?php
if
(
$web_user_id
)
{
// Do not display if no user is provided
?>
<h2
style=
"clear:both;"
>
Posts de
<?php
echo
$tit
;
?>
en Wikitoki.org:
</h2>
<ul>
<!-- The Loop of posts by author -->
<?php
$args
=
array
(
'post_type'
=>
'post'
,
//sets post type to "Project"
'order'
=>
'DESC'
,
'author'
=>
$web_user_id
,
'posts_per_page'
=>
-
1
,
);
$my_query
=
new
WP_Query
(
$args
);
$wp_count
=
$my_query
->
post_count
;
if
(
$my_query
->
have_posts
()
)
:
while
(
$my_query
->
have_posts
()
)
:
$my_query
->
the_post
();
?>
<li>
<a
href=
"
<?php
the_permalink
()
?>
"
rel=
"bookmark"
title=
"Permanent Link:
<?php
the_title
();
?>
"
>
<?php
the_title
();
?>
</a>
,
<?php
the_time
(
'd M Y'
);
?>
.
<?php
the_category
(
'|'
);
?>
</li>
<?php
endwhile
;
else
:
?>
<p>
<?php
_e
(
'No posts by this author.'
);
?>
</p>
<?php
endif
;
?>
<!-- End Loop -->
</ul>
<?php
}
?>
if
(
$my_query
->
have_posts
()
)
:
while
(
$my_query
->
have_posts
()
)
:
$my_query
->
the_post
();
?>
<li>
<a
href=
"
<?php
the_permalink
()
?>
"
rel=
"bookmark"
title=
"Permanent Link:
<?php
the_title
();
?>
"
>
<?php
the_title
();
?>
</a>
,
<?php
the_time
(
'd M Y'
);
?>
.
<?php
the_category
(
'|'
);
?>
</li>
<?php
endwhile
;
else
:
?>
<p>
<?php
_e
(
'No posts by this author.'
);
?>
</p>
<?php
endif
;
?>
<!-- End Loop -->
</ul>
<?php
if
(
$feed
)
{
// do not display if no feed is provided
?>
<h2>
<?php
//Lists posts in feed from users website
_e
(
'Posts de'
,
'wikitoki'
);
?>
<?php
echo
$tit
;
?>
<?php
_e
(
'en su blog'
,
'wikitoki'
);
?>
.
</h2>
<?php
// Get RSS Feed(s)
// code from http://www.wpbeginner.com/wp-tutorials/how-to-display-any-rss-feed-on-your-wordpress-blog/
include_once
(
ABSPATH
.
WPINC
.
'/feed.php'
);
// Get a SimplePie feed object from the specified feed source.
$rss
=
fetch_feed
(
$feed
);
if
(
!
is_wp_error
(
$rss
)
)
:
// Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 5.
$maxitems
=
$rss
->
get_item_quantity
(
5
);
// Build an array of all the items, starting with element 0 (first element).
$rss_items
=
$rss
->
get_items
(
0
,
$maxitems
);
endif
;
<h2>
<?php
//Lists posts in feed from users website
_e
(
'Posts de'
,
'wikitoki'
);
?>
<?php
echo
$tit
;
?>
<?php
_e
(
'en su blog'
,
'wikitoki'
);
?>
.
</h2>
<?php
// Get RSS Feed(s)
// code from http://www.wpbeginner.com/wp-tutorials/how-to-display-any-rss-feed-on-your-wordpress-blog/
include_once
(
ABSPATH
.
WPINC
.
'/feed.php'
);
// Get a SimplePie feed object from the specified feed source.
$rss
=
fetch_feed
(
$feed
);
if
(
!
is_wp_error
(
$rss
)
)
:
// Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 5.
$maxitems
=
$rss
->
get_item_quantity
(
5
);
// Build an array of all the items, starting with element 0 (first element).
$rss_items
=
$rss
->
get_items
(
0
,
$maxitems
);
endif
;
?>
<ul>
<?php
if
(
$maxitems
==
0
)
:
?>
<li>
<?php
_e
(
'No items'
,
'my-text-domain'
);
?>
</li>
<?php
else
:
?>
<?php
// Loop through each feed item and display each item as a hyperlink. ?>
<?
php
foreach
(
$rss_items
as
$item
)
:
?>
<li>
<a
href=
"
<?php
echo
esc_url
(
$item
->
get_permalink
()
);
?>
"
title=
"
<?php
printf
(
__
(
'Posted %s'
,
'my-text-domain'
),
$item
->
get_date
(
'j F Y | g:i a'
)
);
?>
"
>
<?php
echo
esc_html
(
$item
->
get_title
()
);
?>
</a>
</li>
<?php
endforeach
;
?>
<?php
endif
;
?>
</ul>
<ul>
<?php
if
(
$maxitems
==
0
)
:
?>
<li>
<?php
_e
(
'No items'
,
'my-text-domain'
);
?>
</li>
<?php
else
:
?>
<?php
// Loop through each feed item and display each item as a hyperlink. ?>
<?
php
foreach
(
$rss_items
as
$item
)
:
?>
<li>
<a
href=
"
<?php
echo
esc_url
(
$item
->
get_permalink
()
);
?>
"
title=
"
<?php
printf
(
__
(
'Posted %s'
,
'my-text-domain'
),
$item
->
get_date
(
'j F Y | g:i a'
)
);
?>
"
>
<?php
echo
esc_html
(
$item
->
get_title
()
);
?>
</a>
</li>
<?php
endforeach
;
?>
<?php
endif
;
?>
</ul>
<?php
}
?>
</div>
...
...
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