New answers tagged

1

To expand your conditional to check for display of one of your terms, you can do this: if ( is_page() ) { the_title(); } elseif ( is_tag() ) { single_tag_title(); } elseif ( is_tax( 'mtags' ); ) { single_term_title('More Tags: '); } However, if you use your theme's custom taxonomy template for this taxonomy, taxonomy-mtags.php, then you can ...


0

As our attempts to help don't seem to have worked, I've taken your code as the question currently shows: <?php /* Template Name: Trends */ get_header(); ?> <section id="top"> <?php the_post(); ?> <div class="intro"><?= get_the_title(); ?></div> <?php the_content();?> <?php $args = array( ...


0

What I see is , you are not following WP coding standard. <?= get_the_title(); ?> is not allowed in WP coding standard. Now you are getting only the post and not as per your args provided, this means you have not reset your main WP Query. We can write the above code as : <?php /* Template Name: Trends */ get_header(); ?> // Primary loop ...


2

These are almost certainly custom post types. In the definition of the custom post type, it is possible to define a menu_icon which can be a file or an icon from the iconfont. It is this menu_icon that is showing up in your admin menu. I also notice "Programs Categories" in your menu, this looks like a custom options page - which will have also been ...


2

I would not recommend using subpages for sections for the following reasons: The section subpages can be deleted, set to draft and many other misuses by mistake. It is difficult to control the user input on them. There is no easy way to deal with booleans or options, such as "show/hide this" or "use design 2 for this section". When retrieving the page ...


0

Posting answer found by the OP, as originally edited into the question and expanded on in comments: Here is what I ended up doing, which works a charm. I put this in my sidebar.php. Basically, it works with the custom post type name to check that it's a single post with that type. If so, I tell it to append a list of all the pages that are children of ...


0

Here you go. I think the first problem was calling do_shortcode($content) that gets called by add_shortcode() so it's redundant here. Then I think calling wpautop($content) introduced another problem rather than getting closer to a solution. function articlesection_rs_shortcode($atts, $content) { return '<span itemprop="articleSection">'. $content .'...


0

It is normal to have some text used in template. Typically that would be pieces of "technical" text, related to interface and which must be in code to be localized. In solutions meant for public use it is certainly not normal practice to have actual content hardcoded in templates. For private projects it is more or less — do what makes sense to you. One ...


0

May be you need this theme... Try it out it's a free theme and same as per your requirement. It's a one page website theme available on wordpress.org. https://wordpress.org/themes/one-page/ Check out the demo here https://wp-themes.com/one-page/


0

Unless you have generated metafields called 'home', 'about', 'contact' and 'services' in functions.php using add_post_meta your calls to get_post_meta will always return false. So if you test if they are true later on, the answer is 'no' and nothing will be displayed.


0

Where is the fold now? to me, the fold is a little outdated, as it fully depends on the device/monitor size. It may be that JavaScript in the header of your site is blocking the page load. The best way to combat this is to simply load the JavaScript in the footer of the site instead.


0

In general page URL are "last resort" match when nothing else fully matches the URL. This means that you can have something like example.com/category/cat1 be a URL of a category and example.com/category/cat1/page1 be a URL of a page. For the last to work you obviously need a grandpa page with slug "category" and a father page with slug "cat1". It is not ...


0

I think it would be best to do a template override in Woocommerce. If by single you mean a page when viewing only one product then look at the single-product.php template. The directory it needs to located is: /public_html/wp-content/themes/your-theme/woocommerce/single-product.php. You can download the template overrides from woothemes.


3

You can always make use of the page_template filter to tell WordPress to use a specific page template for all child pages of a certain parent. It is as easy as creating a special page template, lets call it page-wpse-person.php. Now it is as easy as including that template whenever a child page of people is being viewed. For the sake of example, lets say ...


2

The easiest way would be to create a custom post type 'person', in which you include the custom fields. The WordPress template hierarchy would then ensure that the single-person.php template is used for those posts.


0

Using template_include (as suggested by Brad Dalton) only changes the page template on the front end, not in the admin when editing a page. On the other hand, changing the value in the post object before the metabox is rendered, as suggested by czerspalace, works! I added a check to only apply this when $post->page_template is not set, like this: ...


1

You need the WP_Query documentation. WP_Query is very powerful, and you can do a lot with it :) In your case, I don't think exclude is a valid parameter. What you're probably looking for is this: $query->set( 'post__not_in', array( 34 ) ); Here's the Post & Page Parameters section of the documentation, which covers this and the other parameters ...


1

Duplicates don't just come from Pages and Posts, WordPress also defines Images and Files from the Media Library as "Posts". This means if you have a file / image in the Media Library with the same name as a page, it will assign the next duplicate a -2 ( from the wp_unique_post_slug() function ) so there's no URL conflicts. TL;DR - Duplicate? Search for ...


1

Since 3.7 there is a filter to change the width of the wrapping div directly. This will fix the extra 10px, and won't let the caption extend past the width of the image (unlike width: auto !important). function wp456_img_caption_width( $width, $atts, $content){ //by default 10 is added if image caption return $width - 10; } add_filter( '...


-1

A plugin to the rescue. It looks like WPFront User Role Editor is what I was looking for. It produces a very granulated menu of what each role can do. This looks promising.


0

For editing content, I used the plugin Advanced Custom Fields. As for the conditionals, I just added if (is_page_template('template_name.php') before each wp_enqueue_script.


0

This is generally not a good idea. See this WordPress database diagram. You need to consider: posts that have categories or tags (terms), their relationships, term meta, and taxonomies posts that have authors (users) posts that have comments things that are actually posts that you might not realise are posts (eg. almost everything in WordPress is a post - ...


0

Content includes the author user and comments (and probably more). Dumping just part of the DB as a way to export/import doesn't sound like a very robust idea. DBs are relatively small, and there is almost no reason not to export/import the full DB instead of trying to hack things.



Top 50 recent answers are included