I have a custom post type with custom category taxonomy. On the CPT single templae I want to list out other posts in same categories, but I can't get it to work. My current code: <?php foreach ( Roots\Sage\Utils\get_the_category_bytax( get_the_ID(), 'project_category' ) as $cat ) $category_ids[] = $cat->term_id; $projects = new WP_Query( array( 'post_status' => 'publish', 'post__in' => get_post_meta( get_the_ID(), 'carbonlimits_project_related', true ), 'post__not_in' => array( $current_post_id ), 'category__and' => $category_ids, 'post_type' => 'project', 'caller_get_posts' => 1, 'posts_per_page' => 4 …
I use http://github.com/jjgrainger/PostTypes/ to register my custom post types and ACF to add custom fields to my custom post and I want to include in my wp-json response all registered fields per post and I do the following $options = [ 'supports' => array('revisions'), 'has_archive' => false, 'show_in_rest' => true, 'rewrite' => array('slug' => __('teachers', 'teachers')), 'capability_type' => 'post', 'rest_base' => 'teachers', 'query_var' => true, 'rest_controller_class' => 'WP_REST_Posts_Controller', ]; $teachers = new PostType('teacher', $options); $locations = new Taxonomy('location'); $levels = …
I originally posted in the Sage forum here. I'm trying to get a plugin to work but it's not, and I feel like it's a very general Namespace problem, and not something with the actual plugin, so I feel I could find success here. The plugin (and it's code/repo) is here: https://github.com/ItinerisLtd/acf-gutenblocks Any ideas how I can solve this error? Fatal error: Uncaught Error: Class 'Itineris\AcfGutenblocks\Plugin' not found in /app/public/wp-content/plugins/acf-gutenblocks/acf-gutenblocks.php:32 Stack trace: #0 /app/public/wp-includes/class-wp-hook.php(286): Itineris\AcfGutenblocks\{closure}('') #1 /app/public/wp-includes/class-wp-hook.php(310): WP_Hook-&gt;apply_filters('', Array) #2 …
Currenty I’m building a website with Roots Sage as my template. The template works like a charm. But for the import of vehicles we use a plugin. The override in the /resources/ is working. For example if I place in this file it shows me the title of the document. But when I use the default formatting of the template it gives me errors like this: Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function listing() on null in /wp-content/themes/mytheme/resources/view/voertuig/single.php:18 …
I have a 3 level deep navigation menu which will show beside all pages on the site except the homepage. The issue is only 2 of my 3 levels are showing in the menu when displaying it using the wp_nav_menu. I've tried specifying the depth parameter and without it to no avail. I am using the Roots theme if that helps. See below for an image as to how the menu is in the Appearance > Menus section. The problem …
I'm using Roots Bedrock + Sage 9 Beta 3. I've created a custom post of type lp that I want to set as my homepage. Here is the code I'm using: function cptui_register_my_cpts_lp() { /** * Post Type: Landing Pages. */ $labels = array( "name" => __( 'Landing Pages', 'sage' ), "singular_name" => __( 'Landing Page', 'sage' ), ); $args = array( "label" => __( 'Landing Pages', 'sage' ), "labels" => $labels, "description" => "Pages without menus and/or totally custom …
I've created e Custom post type with Roots theme, adding the custom script inside functions.php like require_once locate_template('/lib/custom-post-types.php'); // Custom post types After that in backend the list of pages is not displayed, and in frontend show this Warning: Warning: strpos() expects parameter 1 to be string, array given in /wordpress/wp-includes/query.php on line 2375 Warning: urldecode() expects parameter 1 to be string, array given in /wordpress/wp-includes/post.php on line 3901 Warning: urlencode() expects parameter 1 to be string, array given in …
I'm using Root.io's Trellis workflow. I've encountered an error wherein I couldn't establish a connection via ansible-playbook. When I run ansible-playbook server.yml -e env=staging it throws me an error that the ssh connection cannot be established so I checked my users.yml file and saw a problem under the keys section: - name: "{{ admin_user }}" groups: - sudo keys: - "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" - https://github.com/dummyuser.keys I realised I have an existing id_rsa.pub key but I didn't have it authorized …
I'm building a WordPress theme, using Roots as a starter theme. Are there any tutorials telling me how to build a theme off of Roots? I've worked with starter themes before, but this one is a whole new monster. I don't know what I'm supposed to edit, and what I'm not supposed to edit.
I have a (Roots/Sage-based) theme with a home.php template override and on that page am displaying excerpts and featured image for each post. <?php while (have_posts()) : the_post(); ?> <div class=".container-fluid"> <?php if (get_post_type() == 'instruments') {?> <div class="col-md-3"> <h1><?php the_ID(); ?></h1> <a href="<?php get_post_permalink(the_permalink()) ?>"><?php the_post_thumbnail( 'medium' ); ?></a> <?php get_template_part('templates/content', get_post_type() != 'post' ? get_post_type() : get_post_format()); ?> </div> </div> <?php } ?> <?php endwhile; ?> Seems relatively simple and is working, but it was just by trial …
I need to display all thumbnails of a gallery on the homepage using the Roots theme with links to one page with a shortcode. The gallery has to be loaded as list items using BX Slider's jQuery to create a carousel. HTML code: <ul class="bxslider"> <li><img src="http://placehold.it/750x150" /></li> <li><img src="http://placehold.it/750x150" /></li> <li><img src="http://placehold.it/750x150" /></li> <li><img src="http://placehold.it/750x150" /></li> </ul> The slider by itself is already working. Now I want to load images from the home gallery with titles beneath the images …
I'm building a multi-site project locally using the VVV Vagrant VM. I setup a sub-domain multisite install with domain mapping and two sub-sites. Everything works fine. This was my sandbox that I used to get started and figure things out. Now I've setup a new, exact replica (obviously URLS are different) of that working multi-site network on the same VM. Everything seems fine with the primary site, but when I create a new sub-site, its broken. I'm getting 404s for …
I am considering different starter themes such as _s and roots. Roots looks very good, especially its sass fork. Anyway, there's one thing that concerns me. It seems like Roots doesn't follow the WordPress coding standards of themes and plugins. What standard do I then follow if I want to use Roots as a starter theme?
So I'm trying to create a custom post type for my theme. I've written the function to register the post type and I can add a post from the admin panel, but when I try to view the new post's permalink, I get a 404 not found page. Here's my post type function: add_action( 'init', 'create_press_coverage' ); function create_press_coverage() { register_post_type( 'press_coverage', array( 'labels' => array( 'name' => 'Press Coverages', 'singular_name' => 'Press Coverage', 'add_new' => 'Add New', 'add_new_item' => …
I'm using this script to catch posts from a custom post type $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array( 'post_status' => array('publish', 'future'), 'post_type' => 'evento', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 9, 'paged' => $paged ); If I set Settings >> Reading >> Blog pages show at most to 6, site return 404 on the second page. If I set to 5, works fine. Why it happens? I'm using roots theme.
When I deploy my wordpress site using Mark Jaquith's capistrano recipes, I get a 500 internal error when trying to activate my roots.io theme. All other default themes work. Here are my server logs: require_once(/www/*********.*********.*********/releases/20140116200222/wordpress): failed to open stream: No such file or directory in /www/*********.*********.*********/releases/20140116200222/wordpress/wp-content/themes/roots/functions.php on line 5, referer: http://*********.*********.*********/wordpress/wp-admin/themes.php [Thu Jan 16 20:05:34 2014] [error] [client *********] PHP Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/share/pear:/usr/share/php') in /www/*********.*********.*********/releases/20140116200222/wordpress/wp-content/themes/roots/functions.php on line 5, referer: http://*********.*********.*********/wordpress/wp-admin/themes.php Here's my folder structure: So …
If I have built a site using an existing theme (i.e. "Twenty-Ten"), but then modified it considerably and want to re-name it entirely, how would I go about doing this without breaking all the links? I know I can simply text-edit the style.css to change the name there, but I'm referring to the root all throughout the install: <link rel='stylesheet' href='http://myWebsite.com/wp-content/themes/CURRENTTHEMENAME/styles/style.css" /> to .... <link rel='stylesheet' href='http://myWebsite.com/wp-content/themes/NEWTHEMENAME/styles/style.css" />
WordPress is 404ing all of my Custom Post Type posts. Have I missed a step here? I’m using the following to set up my CPT: function custom_post_types() { register_post_type( 'creativework', array( 'labels' => array( 'name' => _x('Works', 'post type general name'), 'singular_name' => _x('Work', 'post type singular name'), 'add_new' => _x('Add New', 'Work'), 'add_new_item' => __('Add New Work'), 'edit_item' => __('Edit Work'), 'new_item' => __('New Work'), 'all_items' => __('All Works'), 'view_item' => __('View Work'), 'search_items' => __('Search Works'), 'not_found' => …
I am developing a child theme based on the roots theme. I created a front-page.php and added the following. I test that the page is loaded because I see the I am loaded text. However, the scripts are not loaded. What is wrong with my setup? <?php function dd_register_scripts() { wp_register_script( 'something', get_template_directory_uri() . '/assets/js/something.min.js', array('jquery'), null, false ); } function dd_enqueue_scripts() { wp_enqueue_script('something'); } add_action('init', 'dd_register_scripts'); add_action('wp_enqueue_scripts', 'dd_enqueue_scripts'); ?> <div id="asd">I am loaded</div>
I want to rename the theme's root folder for security purpose. I put these in wp-config.php file: But I want to rename the theme's root directory also: define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/assets' ); define( 'WP_CONTENT_URL', 'http://www.domain.in/assets'); define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/extension' ); define( 'WP_PLUGIN_URL', 'http://www.domain.in/assets/extension'); So, how to rename the theme's root folder like this way?