Posts: 155
Threads: 10
Joined: Jul 2012
2019-03-18, 18:36:07
(This post was last modified: 2019-03-25, 19:28:44 by Riianna.)
How about, or is there, funktion that one can select in post options which page to show each news?.
Like if i have news about football i can select from post options to show that football news in football page etc .
Posts: 56
Threads: 5
Joined: Jan 2018
(2019-03-16, 00:47:24)Carlos Wrote: (2019-03-15, 23:28:23)acenda Wrote: Hi Carlos. How can I use the post picture in og:image? Is there a way to print picture's url?
Thanks!
You can use nm_post_image_url() with optional parameters width, height, crop (see NM template tags (since 3.0))
Example (insert in your template's <head> section):
Code: <?php if (nm_post_has_image()) { ?>
<meta property="og:image" content="<?php nm_post_image_url(640,480,1); ?>">
<?php } ?>
Ok, many thanks mate!
Posts: 155
Threads: 10
Joined: Jul 2012
How to hide specifig news and specifig tag?.
Like if i have news "Salmon fishing" tagget with "fishing", and i dont want to that "Salmon fishing" news appear in in news listing page and i dont want tag "fishing" appear in tag cloud,tag listing etc.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2019-03-18, 18:36:07)Riianna Wrote: How about, or is there, funktion that one can select in post options which page to show each news?.
Like if i have news about football i can select from post options to show that football news in football page etc .
That's not currently possible, sorry.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2019-04-01, 18:23:51)Riianna Wrote: How to hide specifig news and specifig tag?.
Like if i have news "Salmon fishing" tagget with "fishing", and i dont want to that "Salmon fishing" news appear in in news listing page and i dont want tag "fishing" appear in tag cloud,tag listing etc.
You can:
- use "invisible tags" (prefix tags with an underscore, like _mytag )
and/or
- Exclude posts by tag:
Code: define('NMDEFAULTEXCLUDETAGGED', 'mytag1,mytag2,mytag3');
(insert in gsconfig)
more info here
Posts: 5
Threads: 0
Joined: Dec 2018
(2019-02-26, 05:51:41)Carlos Wrote: Insert this in your template, before <?php get_header(); ?>
Code: <?php
$arr =array(
"tag1" => "This is the meta description for tag1",
"tag2" => "This is the meta description for tag2",
"tag3" => "This is the meta description for tag3",
// etc...
);
if (nm_is_tag()) foreach ($arr as $t=>$m) if (nm_is_tag($t)) {$metad=$m; break;}
?>
(If you prefer to have it in a component or a function, a small change would be required.)
Hello, Carlos!
When this code is inserted directly in template everything works just fine. But when I'm trying to use this as a component there is no meta description in the page source code...
The component code:
Code: <?php
$arr = array(
"сравнение" => "Метаописание для тега сравнение",
"вывески" => "Метаописание для тега вывески",
);
if (nm_is_tag()) foreach ($arr as $t=>$m) if (nm_is_tag($t)) {$metad=$m; break;}
?>
The component in template:
Code: <head>
//some code here
<?php get_component('tagsmeta'); ?>
<?php nm_get_header(); ?>
//some code here
</head>
What am I doing wrong?
Posts: 3,491
Threads: 106
Joined: Mar 2010
To make it work in a component, insert this:
just after the <?php tag.
Posts: 5
Threads: 0
Joined: Dec 2018
(2019-04-23, 02:16:21)Carlos Wrote: To make it work in a component, insert this:
just after the <?php tag.
Thank you very much! It works
Posts: 44
Threads: 8
Joined: May 2014
Hello!
The NM setting is set Enable post image -> Yes.
If I do not select an image when creating new news - is there a way to set the default image, but only in the sidebar. I use the following code:
PHP Code: <?php nm_custom_display_recent( '<div class="my_recent_{{ post_number }}" style="padding:15px 0; border-bottom:solid #ddd 1px;"> <h2><a href="{{ post_link }}">{{ post_title }}</a></h2> <p><a href="{{ post_link }}">{{ post_image }}</a></p> <span class="my_excerpt">{{ post_excerpt }}</span> </div>' );?>
Thank you,
Posts: 3,491
Threads: 106
Joined: Mar 2010
Posts: 44
Threads: 8
Joined: May 2014
(2019-05-10, 05:10:29)Carlos Wrote: See here: http://get-simple.info/forums/showthread...7#pid64237
Thanks, that's it.
Posts: 166
Threads: 7
Joined: Jan 2013
I'd love to be able to customize News Manager (updated) to use it for a What's-on, or Coming Events page. So I'm wondering if it is possible to customise the published date field so that it would be my event date. That would mean I'd have to have NM display future dated posts.
All advice welcome please, or has anything similar been done before?
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2019-07-27, 20:50:30)davetest Wrote: I'd love to be able to customize News Manager (updated) to use it for a What's-on, or Coming Events page. So I'm wondering if it is possible to customise the published date field so that it would be my event date. That would mean I'd have to have NM display future dated posts.
All advice welcome please, or has anything similar been done before?
You can do it with the NM Addons plugin. An example here:
http://get-simple.info/forums/showthread...1#pid63451
Posts: 166
Threads: 7
Joined: Jan 2013
Thank you Carlos. Absolutely brilliant, just what I needed. Please can you let me have code to use for your 'past events' example? Thanks again.
Posts: 3,491
Threads: 106
Joined: Mar 2010
Just insert a link to the 'events' (or whatever) tag page:
example.com/newspage/tag/events
or
example.com/newspage/?tag=events
or... (others, depending on your GS and NM permalink setup)
Posts: 166
Threads: 7
Joined: Jan 2013
Thanks Carlos. Got it.
Back to the original question of creating a future events list ( I'm putting mine inside another page via DynPages), I've just noticed that any events dated today don't appear with the future events. Is it possible to get then to show, or any other way to just show toda's seperately?
Posts: 3,491
Threads: 106
Joined: Mar 2010
You can set their time to 23:59, so that they are future posts (until 00:00 is reached).
Posts: 3,491
Threads: 106
Joined: Mar 2010
I'll add an option to display today's posts.
Posts: 166
Threads: 7
Joined: Jan 2013
Thanks Carlos, you're a star. your 23:59 trick worked a treat, but this will be even better.
Posts: 109
Threads: 7
Joined: Nov 2012
Is there a way to display the meta description of posts with nm_custom_display_recent like
PHP Code: nm_custom_display_recent("Title: {{ post_title }}<br>Description: {{ post_metad }}");
Alex
Posts: 3,491
Threads: 106
Joined: Mar 2010
Not currently, but I'll add support for that.
Posts: 56
Threads: 5
Joined: Jan 2018
Hi Carlos. One of my clients has a problem with set and News Manager. For some reason, sitemap doesn't show posts. There is only sites. Is there an easy solution? GS version 3.15 and NMu version 3.6.
Posts: 3,491
Threads: 106
Joined: Mar 2010
Does the site have some plugin like I18N, that generates its own Sitemap?
Posts: 56
Threads: 5
Joined: Jan 2018
2019-10-29, 23:48:07
(This post was last modified: 2019-10-29, 23:54:20 by acenda.)
(2019-10-23, 03:19:59)Carlos Wrote: Does the site have some plugin like I18N, that generates its own Sitemap?
Yes. I18N base, I18N search and I18N Search for news manager posts.
Here is image off all plugins. Right side RED color indicates that the plugin is active.
Posts: 3,491
Threads: 106
Joined: Mar 2010
The I18N plugin doesn't run GetSimple's 'sitemap' filter, so News Manager cannot insert its posts in the Sitemap.
You can try patching the I18N plugin:
http://get-simple.info/forums/showthread...5#pid47765
Make sure to check posts' URLs are correct in the sitemap.xml file - it depends on your permalink structure.
|