{"id":31633,"date":"2019-04-23T00:00:00","date_gmt":"2019-04-22T18:30:00","guid":{"rendered":"https:\/\/git-staging.wpastra.com\/?post_type=docs&#038;p=31633"},"modified":"2022-02-23T14:14:22","modified_gmt":"2022-02-23T08:44:22","slug":"replace-navigation-strings-on-single-post","status":"publish","type":"docs","link":"https:\/\/git-staging.wpastra.com\/es\/docs\/replace-navigation-strings-on-single-post\/","title":{"rendered":"\u00bfC\u00f3mo cambiar el texto de los enlaces anterior y siguiente de una sola entrada de blog?"},"content":{"rendered":"<p> A veces puede que necesite cambiar los enlaces de navegaci\u00f3n (Anterior y Siguiente ) a texto en la entrada del blog. Las cadenas por defecto para los enlaces de navegaci\u00f3n ser\u00e1n - Previous Post y Next Post. Puede cambiarlo utilizando los siguientes filtros.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Sustituir las cadenas de navegaci\u00f3n por defecto por siguiente\/anterior <strong>t\u00edtulos de puestos <\/strong><\/h3>\n\n\n\n<p>El siguiente filtro obtendr\u00e1 el t\u00edtulo de la entrada Anterior y Siguiente y los mostrar\u00e1 como enlaces de navegaci\u00f3n. <\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>add_filter( 'astra_single_post_navigation', 'astra_change_next_prev_text' );\n\n\/**\n * Function to change the Next Post\/ Previous post text.\n *\n * @param array $args Arguments for next post \/ previous post links.\n * @return array\n *\/\nfunction astra_change_next_prev_text( $args ) {\n\t$next_post = get_next_post();\n\t$prev_post = get_previous_post();\n\t$next_text = false;\n\tif ( $next_post ) {\n\t\t$next_text = sprintf(\n\t\t\t'%s &lt;span class=\"ast-right-arrow\"&gt;\u2192&lt;\/span&gt;',\n\t\t\t$next_post-&gt;post_title\n\t\t);\n\t}\n\t$prev_text = false;\n\tif ( $prev_post ) {\n\t\t$prev_text = sprintf(\n\t\t\t'&lt;span class=\"ast-left-arrow\"&gt;\u2190&lt;\/span&gt; %s',\n\t\t\t$prev_post-&gt;post_title\n\t\t);\n\t}\n\t$args&#91;'next_text'] = $next_text;\n\t$args&#91;'prev_text'] = $prev_text;\n\treturn $args;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Sustituir las cadenas de navegaci\u00f3n por defecto por <strong>texto personalizado <\/strong><\/h3>\n\n\n\n<p>El siguiente filtro reemplazar\u00e1 los enlaces Anterior y Siguiente con su texto personalizado. Puede reemplazar su texto con - 'Mi Texto Personalizado Anterior' y 'Mi Texto Personalizado Siguiente' en el siguiente c\u00f3digo de filtro. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2019\/08\/ast-2-change-text.png\"><img decoding=\"async\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2019\/08\/ast-2-change-text.png\" alt=\"Astra Navigate Text\" class=\"wp-image-39780\"\/><\/a><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>add_filter( 'astra_single_post_navigation', 'astra_change_next_prev_text' );\n \n\/**\n * Function to change the Next Post\/ Previous post text.\n *\n * @param array $args Arguments for next post \/ previous post links.\n * @return array\n *\/\nfunction astra_change_next_prev_text( $args ) {\n    $next_post = get_next_post();\n    $prev_post = get_previous_post();\n    $next_text = false;\n    if ( $next_post ) {\n        $next_text = sprintf(\n            '%s &lt;span class=\"ast-right-arrow\"&gt;\u2192&lt;\/span&gt;',\n            'My Next Custom Text'\n        );\n    }\n    $prev_text = false;\n    if ( $prev_post ) {\n        $prev_text = sprintf(\n            '&lt;span class=\"ast-left-arrow\"&gt;\u2190&lt;\/span&gt; %s',\n            'My Previous Custom Text'\n        );\n    }\n    $args&#91;'next_text'] = $next_text;\n    $args&#91;'prev_text'] = $prev_text;\n    return $args;\n}<\/code><\/pre>\n\n\n\n<p><strong>Nota:<\/strong>&nbsp;A\u00f1ada el c\u00f3digo anterior en el campo&nbsp;<a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/add-custom-php-code\/#3.-in-child-theme\">archivo functions.php del tema hijo.<\/a><br><\/p>","protected":false},"excerpt":{"rendered":"<p>A veces puede que necesite cambiar los enlaces de navegaci\u00f3n (Anterior y Siguiente ) a texto en la entrada del blog. Las cadenas por defecto para los enlaces de navegaci\u00f3n ser\u00e1n - Previous Post y Next Post. Puede cambiarlo utilizando los siguientes filtros. 1. Reemplace las cadenas de navegaci\u00f3n por defecto con los t\u00edtulos de la entrada anterior\/siguiente El siguiente filtro obtendr\u00e1 [...]<\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[2111],"docs_tag":[],"class_list":{"0":"post-31633","1":"docs","2":"type-docs","3":"status-publish","5":"docs_category-blog-filters"},"spectra_custom_meta":{"_wp_old_slug":["how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post|how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post","how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post|how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post","how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post|how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post","how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post|how-to-change-previous-and-next-link-text-from-a-single-blog-post|alter-navigation-strings-on-single-post"],"_wp_page_template":["default"],"wpil_sync_report3":["1"],"wpil_links_inbound_internal_count":["0"],"wpil_links_inbound_internal_count_data":["a:0:{}"],"wpil_links_outbound_internal_count":["1"],"wpil_links_outbound_internal_count_data":["a:1:{i:0;a:9:{s:3:\"url\";s:80:\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2019\/08\/ast-2-change-text.png\";s:8:\"url_real\";s:80:\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2019\/08\/ast-2-change-text.png\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:123:\"<img src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2019\/08\/ast-2-change-text.png\" alt=\"\" class=\"wp-image-39780\"\/>\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}}"],"wpil_links_outbound_external_count":["0"],"wpil_links_outbound_external_count_data":["a:0:{}"],"wpil_sync_report2_time":["2019-08-28T08:19:44+00:00"],"_edit_lock":["1645605864:77"],"_ppc_meta_key":["a:8:{s:20:\"ppc_key5d92f85d42273\";s:60:\"Images &amp; Names Correctly. Title &amp; Alt Tags are Given\";s:8:\"ppc_key4\";s:15:\"Formatting Done\";s:8:\"ppc_key2\";s:23:\"Featured Image Assigned\";s:8:\"ppc_key3\";s:17:\"Category Selected\";s:8:\"ppc_key5\";s:15:\"Title is Catchy\";s:8:\"ppc_key6\";s:22:\"Social Images Assigned\";s:8:\"ppc_key7\";s:8:\"Done SEO\";s:8:\"ppc_key8\";s:28:\"Spelling and Grammar Checked\";}"],"_edit_last":["77"],"onesignal_meta_box_present":["1"],"onesignal_send_notification":[""],"tap_disable_autolinker":["no"],"tap_autolink_inside_heading":["global"],"tap_autolink_random_placement":["global"],"tap_post_autolinker_limit":["0"],"site-sidebar-layout":["default"],"site-content-layout":["default"],"theme-transparent-header-meta":["default"],"_yoast_wpseo_content_score":["90"],"_ht_kb_post_views_count":["10"],"_ht_kb_usefulness":["0"],"_ht_article_order_103":["31633"],"wp_last_modified_info":["February 23, 2022 @ 2:14 PM"],"wplmi_shortcode":["[lmt-post-modified-info]"],"views":["7719"],"helpful":["19"],"unhelpful":["15"],"redirects":["6"],"_lmt_disableupdate":["no"],"_wplmi_last_modified":["2021-09-08 20:27:31"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_analytic_object_id":["877"],"rank_math_seo_score":["15"],"rank_math_internal_links_processed":["1"],"pfd_related_docs":[""],"rank_math_og_content_image":["a:2:{s:5:\"check\";s:32:\"d03e10992b4c63fdedaf520def8d8f42\";s:6:\"images\";a:1:{i:0;i:40927;}}"],"_wpml_media_duplicate":["1"],"_trp_automatically_translated_slug_es_ES":["reemplazar-las-cadenas-de-navegacion-en-un-solo-mensaje"],"_uag_page_assets":["a:9:{s:3:\"css\";s:2495:\".wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-top svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-bottom svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__video-wrap video{opacity: 1;}.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1200px);max-width: var(--inner-content-custom-width);width: 100%;flex-direction: column;align-items: center;justify-content: center;flex-wrap: nowrap;row-gap: 0px;column-gap: 0px;}.wp-block-uagb-container.uagb-block-debf2792{box-shadow: 0px 0px   #00000070 ;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;overflow: visible;border-color: inherit;row-gap: 0px;column-gap: 0px;}@media only screen and (max-width: 976px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1024px);max-width: var(--inner-content-custom-width);width: 100%;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}@media only screen and (max-width: 767px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 767px);max-width: var(--inner-content-custom-width);width: 100%;flex-wrap: wrap;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:6:{i:0;s:14:\"core\/paragraph\";i:1;s:12:\"core\/heading\";i:2;s:9:\"core\/code\";i:3;s:10:\"core\/image\";i:4;s:14:\"uagb\/container\";i:5;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1777027612\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Premanshu","author_link":"https:\/\/git-staging.wpastra.com\/es\/author\/premanshup\/"},"uagb_comment_info":0,"uagb_excerpt":"Sometimes you might need to change the navigation (Previous and Next ) links to text on the single blog post. Default strings for navigation links will be &#8211; Previous Post and Next Post. You can change it using the following filters. 1. Replace default navigation strings with next\/previous post titles The following filter will fetch&hellip;","_links":{"self":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/31633"}],"collection":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/comments?post=31633"}],"version-history":[{"count":0,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/31633\/revisions"}],"wp:attachment":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/media?parent=31633"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_category?post=31633"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_tag?post=31633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}