Pehea e hoʻohui ai i nā pou a me nā ʻano leka maʻamau i nā nīnau WordPress a me ka RSS Feed

ʻO WordPress a i ʻole Elementor Hoʻohui a hoʻohui i nā memo a me nā ʻano leka maʻamau i ka nīnau

ʻO kekahi o nā hiʻohiʻona kupaianaha o WordPress ka hiki ke kūkulu Nā Kūlana Kū Kūhelu. Maikaʻi kēia maʻalahi… no ka mea hiki ke hoʻohana ʻia nā ʻano pou maʻamau no kahi ʻoihana e hoʻonohonoho i nā ʻano pou ʻē aʻe e like me nā hanana, nā wahi, nā FAQ, nā mea kikoʻī maʻalahi. Hiki iā ʻoe ke kūkulu i nā ʻauhau maʻamau, nā kahua metadata hou aʻe, a me nā maʻamau maʻamau e hōʻike iā lākou.

Ma kā mākou pūnaewele ma Highbridge, loaʻa iā mākou kahi ʻano leka maʻamau i hoʻonohonoho ʻia no hana ma waho aʻe o kā mākou blog kahi a mākou e kaʻana nei i nā nūhou o ka hui. Ma ka loaʻa ʻana o kahi ʻano leka maʻamau, hiki iā mākou ke hoʻohālikelike i nā papahana ma kā mākou ʻaoʻao hiki… no laila inā ʻoe e nānā i kā mākou Nā lawelawe WordPress, nā papahana a mākou i hana ai e pili ana i ka WordPress e hōʻike aunoa. Paʻakikī wau i ka hana e hoʻāʻo nei e palapala i kā mākou papahana āpau i ʻike i kā mākou poʻe kipa pūnaewele i ka nui o nā hana a mākou e hana ai no nā ʻoihana.

Hoʻohui ʻana i nā memo a me nā ʻano leka maʻamau

Ua nui loa ko mākou ʻaoʻao home, no laila ʻaʻole wau i makemake e kūkulu i kahi ʻāpana no kā mākou pou blog A me kahi ʻāpana no kā mākou papahana hou. Makemake au e hoʻohui i nā pou ʻelua a me nā papahana i loko o ka huahana like me ka hoʻohana ʻana i kā mākou mea hana template, Elementor. ʻAʻohe ʻo Elementor kahi interface e hoʻohui a hoʻohui i nā pou a me nā ʻano pou maʻamau, akā maʻalahi ke hana iā ʻoe iho!

I loko o ka ʻaoʻao functions.php theme keiki, eia kahi laʻana o ka hoʻohui ʻana i nā mea ʻelua:

function add_query_news_projects( $query ) {
	if ( is_home() && $query->is_main_query() )
		$query->set( 'post_type', array( 'post', 'project' ) );
	return $query;
}
add_filter( 'pre_get_posts', 'add_query_news_projects' );

ʻO ka kānana pre_get_posts hiki iā ʻoe ke hōʻano hou i ka nīnau a hoʻonohonoho iā ia e kiʻi i kāu pou a me papahana ʻano pou maʻamau. ʻOiaʻiʻo, ke kākau ʻoe i kāu code pono ʻoe e hōʻano hou i ke ʻano o ka leka maʻamau i ka hui inoa inoa maoli o kāu.

Hoʻohui ʻana i nā memo a me nā ʻano leka maʻamau i kāu hānai

Loaʻa iaʻu ka pūnaewele e paʻi maʻalahi i ka pāpaho ma o kāna hānai… no laila makemake wau e hoʻohana i ka nīnau like e hoʻonohonoho i ka hānai RSS. No ka hana ʻana i kēia, pono wau e hoʻohui i kahi ʻōlelo OR a hoʻokomo is_feed.

function add_query_news_projects( $query ) {
	if ( is_home() && $query->is_main_query() || is_feed() )
		$query->set( 'post_type', array( 'post', 'project' ) );
	return $query;
}
add_filter( 'pre_get_posts', 'add_query_news_projects' );

Hoʻohui ʻia nā memo a me nā ʻano leka ma Elementor

Hoʻokahi memo hou… Elementor he hiʻona maikaʻi loa kahi e hiki ai iā ʻoe ke inoa a mālama i kahi nīnau i loko o kāu pūnaewele. I kēia hihia, ke kūkulu nei au i kahi nīnau i kapa ʻia ʻo news-projects a laila hiki iaʻu ke kāhea iā ia mai ka mea hoʻohana Elementor mea hoʻohana ma ka ʻāpana Posts Query.

function my_query_news_projects( $query ) {
	$query->set( 'post_type', array( 'post', 'project' ) );
}
add_action( 'elementor/query/news-projects', 'my_query_news_projects' );

Eia ke ʻano o ka nānā ʻana i ka mea hoʻohana Elementor:

ninau pou elementor

Hōʻike: Ke hoʻohana nei wau i kaʻu Elementor loulou pili i kēia ʻatikala.